title: Bitbucket webhook to trigger Jenkins job
body: <p>I'm having trouble getting my webhook in bitbucket server to start a Jenkins job.  I've read through the other answered questions on here and can't get it going.</p>
  
  <p><strong>Bitbucket setup:</strong></p>
  
  <ul>
  <li>No special plugins installed</li>
  <li>In repository settings I have a webhook set up</li>
  <li>URL: <a href="http://[my" rel="noreferrer">http://[my</a> jenkins url]/bitbucket-hook/ (yes I have the trailing slash)</li>
  <li>Repo Push event selected</li>
  </ul>
  
  <p><strong>Jenkins setup:</strong></p>
  
  <ul>
  <li>Bitbucket plugin installed</li>
  <li>Created new job</li>
  <li>Set SCM to Git and added repo details</li>
  <li>Set branches to build to either ** or refs/heads/rob-jenkins (a branch in git)</li>
  <li>Build when a change is pushed to bitbucket selected</li>
  </ul>
  
  <p><strong>What I do:</strong>
  I make a change to a file in rob-jenkins branch, push and the job is not started in Jenkins.</p>
  
  <p><strong>What I see:</strong>
  In bitbucket, repo settings, webhooks I can see the webhook fired as soon as the commit is pushed.  It has a 200 http status code, response body is empty.</p>
  
  <p>In Jenkins I've set up a logger for</p>
  
  <pre><code>com.cloudbees.jenkins.plugins.BitbucketHookReceiver
  com.cloudbees.jenkins.plugins.BitbucketJobProbe
  com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor
  com.cloudbees.jenkins.plugins.BitBucketTrigger
  </code></pre>
  
  <p>And when I look at those logs I can see only 1 entry from com.cloudbees.jenkins.plugins.BitbucketHookReceiver</p>
  
  <pre><code>Received commit hook notification : {"eventKey":"repo:refs_changed","date":"2018-05-22T12:18:11+1000","actor":{"name":"xxxxxx","emailAddress":"xxxxxx@xxxxxx.com","id":53,"displayName":"xxxxxx","active":true,"slug":"xxxxxxx","type":"NORMAL"},"repository":{"slug":"xxxxx","id":1,"name":"xxxxx","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"SS","id":2,"name":"xxxxx","description":"xxxxxx","public":false,"type":"NORMAL"},"public":false},"changes":[{"ref":{"id":"refs/heads/rob-jenkins","displayId":"rob-jenkins","type":"BRANCH"},"refId":"refs/heads/rob-jenkins","fromHash":"1d9ad42fa404c893853094b0072e5b839f787589","toHash":"9bf7dc873f355259e4338ee80afbd246ecbb48a9","type":"UPDATE"}]}
  </code></pre>
  
  <p>There are no other entries in the log.</p>
  
  <p>In the job itself, the BitBucket Hook Log screen just says "Polling has not run yet."</p>
  
  <p>No idea why it isn't triggering the Jenkins job... what am I missing?</p>
  
  <ul>
  <li>I've tried setting the Poll SCM manually and that didn't make a difference.</li>
  <li>I've done a manual build and it works fine</li>
  </ul>