title: Trigger a job by polling multiple GIT repos inside Jenkinsfile
body: <p>At the <a href="https://stackoverflow.com/questions/37395860/jenkinsfile-with-two-git-repositories">Jenkinsfile with two git repositories</a> these is an example of using multiple GIT repositories in a single Jenkins job:</p>
  
  <pre><code>node {
      dir('RepoOne') {
          git url: 'https://github.com/somewhere/RepoOne.git'
      }
      dir('RepoTwo') {
          git url: 'https://github.com/somewhere/RepoTwo.git'
      }
  
      sh('. RepoOne/build.sh')
      sh('. RepoTwo/build.sh')
  }
  </code></pre>
  
  <p>How can I configure this job to track SCM changes of these 2 repositories so that the job triggers each time when at least one of repositories has updates?</p>
  
  <p>The problem is that the job is polling not the repositories mentioned inside Jenkinsfile, but the repository of the Jenkinsfile itself (it is stored in a special repository, not with the source code together) which is mentioned in the GUI configuration of the job.</p>
  
  <p>With the old Jenkins (without coded pipeline) and SVN plugin it was very easy, because all N repositories could be mentioned in the GUI configuration, checked out to a separate sub-directories of the single workspace and simultaneously polled.</p>
  
  <p>How can I reach the same result with GIT + Jenkins Pipeline-As-Code? I tried to use also "poll: true" option in the Jenkinsfile, but it did not help. What does then this option do?</p>
  
  <p>UPDATE 1: Here is the pipeline script which I really use and which does not work:</p>
  
  <pre><code>properties([
      pipelineTriggers([
          scm('H/5 * * * *')
      ])
  ])
  
  node {
    stage ('Checkout') {
      dir('cplib') {
        git(
        poll: true,
            url: 'ssh://git@&lt;server&gt;:&lt;port&gt;/base/cplib.git',
            credentialsId: 'BlueOceanMsl',
            branch: 'master'
        )
      }
      dir('cpmffmeta') {
        git(
        poll: true,
            url: 'ssh://git@&lt;server&gt;:&lt;port&gt;/base/cpmffmeta.git',
            credentialsId: 'BlueOceanMsl',
            branch: 'master'
          )
      }
    }
  
    stage ('Build') {
      ...
    }
  </code></pre>