title: Trigger Jenkins job due to a Azure git repo pull request
body: <p>I've read the documentation in <a href="https://github.com/jenkinsci/tfs-plugin/blob/master/README.md" rel="nofollow noreferrer">this page</a>, and I can see that there's an option to &quot;Trigger a build when a pull request is created&quot;. I did the following:</p>
  In Azure DevOps
  <ol>
  <li>Service Hooks -&gt; Jenkins subscription -&gt; Pull request merge attempted</li>
  <li>Trigger generic build -&gt; specify credentials and a specific build.</li>
  </ol>
  In Jenkins job
  <ol>
  <li>Create a Pipeline Job and check the &quot;Poll SCM&quot; checkbox</li>
  </ol>
  <p>Now, whenever I issue a pull request, a build is indeed triggered, but my question is: how can I clone the Pull Request commit in order for the build to check if the pull request should be completed?</p>
  <p>Another question if you will: I can see in my &quot;Build Triggers&quot; section those checkboxes:</p>
  <ul>
  <li>Build when a change is pushed to a TFS pull request</li>
  <li>Build when a change is pushed to TFS/Team Services</li>
  </ul>
  <p>What is the use of these? since as far as I see, only the &quot;Poll SCM&quot; checkbox will cause a build to run whenever a new commit/pull request is created in the Git repository.</p>
  <h3>EDIT</h3>
  <p>Using a Freestyle job I can make this work by:</p>
  <ol>
  <li>setting the refspecs in the SCM configuration as such:</li>
  </ol>
  <pre><code>+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin-pull/*
  </code></pre>
  <ol start="2">
  <li>setting the &quot;Branches to track&quot; to <code>**</code>, so that the <code>pull/*</code> branches will be tracked and built.</li>
  </ol>
  <p>The question is how to make this work in Pipeline jobs.</p>