title: How to "Scan Repository Now" from a Jenkinsfile
body: <p>I can call another jenkins job using the <code>build</code> command. Is there a way I can tell another job to do a branch scan?</p>
  
  <p>A multibranch pipeline job has a UI button "Scan Repository Now". When you press this button, it will do a checkout of the configured SCM repository and detect all the branches and create subjobs for each branch.</p>
  
  <p>I have a multibranch pipeline job for which I have selected the "Suppress automatic SCM triggering" option because I only want it to run when I call it from another job. Because this option is selected, the multibranch pipeline doesn't automatically detect when new branches are added to the repository. (If I click "Scan Repository Now" in the UI it will detect them.)</p>
  
  <p>Essentially I have a multibranch pipeline job and I want to call it from another multibranch pipeline job that uses the same git repository.</p>
  
  <pre><code>node {
    if(env.BRANCH_NAME == "the-branch-I-want" &amp;&amp; other_criteria) {
      //scanScm "../my-other-multibranch-job" &lt;--- scanScm is a fake command I made up
      build "../my-other-multibranch-job/${env.BRANCH_NAME}"
  </code></pre>
  
  <p>I get an error on that <code>build</code> line, because the target multibranch pipeline job does not yet know that <code>BRANCH_NAME</code> exists. I need a way to trigger an SCM re-scan in the target job from this current job.</p>