title: Why triggering job B from job A in jenkins does not re-checkout, and how to force it to?
body: <p>I have a jenkins' job jenkinsfile that looks like this:</p>
  
  <pre><code>stages {
       stage("X") {
           steps { build job: "Y", parameters: [[$class: 'StringParameterValue', name: 'build_number', value: "${BUILD_NUMBER}"]] }
       }
  }
  </code></pre>
  
  <p>I see that job Y is triggered, but I got a jenkins error there</p>
  
  <pre><code> "org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: No such field found: field java.lang.String BLA
  "
  </code></pre>
  
  <p>I know this error from previous builds, so I checked out the commit that job Y run (the one triggered by stage X in my main job), and indeed, the commit it checked out was an outdated one. If I would have triggered job Y manually (i.e. "build with parameters") I would get a good run, without that error</p>
  
  <ol>
  <li>Why triggering a job from another job does not include a checkout update?</li>
  <li>How can I force an update to the commit the job is checking out</li>
  <li>Are there any more differences between manual triggering and the I do?</li>
  </ol>
  
  <hr>
  
  <p>This is my pipeline configure: <a href="https://i.stack.imgur.com/WnA6U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WnA6U.png" alt="job"></a></p>