title: Trigger jenkins build on stash pull request
body: <p>I've been trying to get the build on PR working for some time now following the usual guides. However i ran into some issues.</p>
  
  <p>Here is what i added to the previously existing configuration @ Jenkins project:</p>
  
  <pre><code>Source Code Management:
  Multiple SCMs
   - Repository URL: ssh://git@git.company.pt/projectCode/RepName.git
   - Credentials with ssh key working
   - Batches to build: */${sourceBranch}
   - Repository browser: auto
   - Additional Behaviours: none
  
  Build triggers:
   - Poll SCM
  </code></pre>
  
  <p>And the the previous working build &amp; post-build actions</p>
  
  <p>On the stash side there is not much to configure. Here is a ss of the existing configurations and its test result @ Settings -> Hooks -> Stash WebHook to Jenkins:</p>
  
  <p><img src="https://i.stack.imgur.com/cS5z6.png" alt="Stash webhook config"></p>
  
  <p>As you can see in the screenshot, the test for this configuration works and it is able to properly send a message to Jenkins. It is received by Jenkins with the following log message: </p>
  
  <pre><code>Started on Apr 29, 2015 8:01:23 AM
  Polling SCM changes on master
  Using strategy: Default
  using GIT_SSH to set credentials 
   &gt; git --version # timeout=10
   &gt; git -c core.askpass=true ls-remote -h ssh://git@git.fraunhofer.pt/glp/golivephone.git # timeout=10
  Done. Took 0.18 sec
  No changes
  </code></pre>
  
  <p>Right, i didn't change anything!
  The problem is when i go to an actual branch and click "Trigger build". The Git polling Log stays exactly the same and no messages is sent to Jenkins. Am i missing some configuration step @ stash or in the branch creation? I dont think it is related to the jenkins build, since i dont even get a Pooling log message when i trigger the build. 
  Even a debug idea would be nice to find out what's wrong. </p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>Network activity when i trigger a build is triggered:
  Request </p>
  
  <pre><code>Remote Address:10.211.8.19:443
  URL:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectCode/repos/repName/triggerJenkins?branch=bugfix/GLP-702-about-screen-doesn-t-update-on-subscription&amp;sha1=cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a
  Request Method:POST
  Status Code:204 No Content
  
  ---PAYLOAD---
  none
  
  ---Query String parameter---
  branch:bugfix/GLP-702-about-screen-doesn-t-update-on-subscription
  sha1:cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a
  </code></pre>
  
  <p>compared to the test one:</p>
  
  <pre><code>Remote Address:10.211.8.19:443
  Request URL:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectCode/repos/repName/test
  Request Method:POST
  Status Code:200 OK
  
  ---PAYLOAD---
  {jenkinsBase: ["http://i-255.cloud.fraunhofer.pt:8080/"],…}
  gitRepoUrl: ["ssh://git@git.fraunhofer.pt/glp/golivephone.git"]
  0: "ssh://git@git.fraunhofer.pt/glp/golivephone.git"
  ignoreCerts: ["TRUE"]
  0: "TRUE"
  jenkinsBase: ["http://i-255.cloud.fraunhofer.pt:8080/"]
  0: "http://i-255.cloud.fraunhofer.pt:8080/"
  omitHashCode: ["TRUE"]
  0: "TRUE"
  
  ---Query String parameter---
  none
  </code></pre>