title: Jenkins Generic Webhook Trigger, for branch specific
body: <p>I am trying to generate a webhook from Bitbucket to trigger a build whenever a user pushes or merges code on a specific branch. I am using the &quot;Generic Webhook Trigger&quot; plugin in Jenkins to do this.</p>
  <p>I have two branches in question:</p>
  <ol>
  <li>Dev_Branch</li>
  <li>UAT_Branch</li>
  </ol>
  <p>I have two separate Jenkin jobs(pipeline), one for <strong>Dev</strong> and one for <strong>UAT</strong>. The jobs build and deploy the code found in their respective branches.</p>
  <p>I have created a webhook on bitbucket and configured the URL to look like this</p>
  <pre><code> http://&lt;jenkins_url&gt;/generic-webhook-trigger/invoke?token=&lt;token_name&gt;
  </code></pre>
  <p>I also checked the boxes for <strong>Push</strong> and <strong>Merge</strong>.</p>
  <p>I created two webhooks one with token_name = &quot;DevToken&quot; and the other &quot;UATToken&quot; and configured both my Jenkins jobs to invoke their token_name.
  However, what I found is that, whenever a push/merge is made to any branch in my repo (even branches outside of Dev_Branch and UAT_Branch), the webhook is triggered and both Jenkin Jobs are built and deployed.</p>
  <p>Can some guide me on how to configure my Jenkin Jobs so that my Dev pipeline is only triggered by changes in Dev_Branch and my UAT pipeline is only triggered by changes in UAT_Branch?</p>
  <p>I have read some tutorials that suggest using the &quot;Post content Parameters&quot; that are pulled from the JSON when a webhook is triggered, but this only stores the values from the JSON into variables. And it wasn't made clear on how to use these variables to configure whether or not the build should be carried out.</p>
  <p>Many Thanks</p>