title: bitbucket webhook to jenkins with branch name
body: <p>i have a bitbucket repo that sends webhook to trigger jenkins job.
  <a href="https://i.stack.imgur.com/vEHwz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vEHwz.png" alt="bitbucket webhook"></a></p>
  
  <p>http://:8080/buildByToken/buildWithParameters?job=webhook_me&amp;token=t
  i want to send with the webhook the bitbucket branch name,
  so i search the web for the right way to use Environment variables on bit bucket and i've found this site:
  <a href="https://i.stack.imgur.com/JrIZf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JrIZf.png" alt="The way to use the variable, and the variable i need"></a></p>
  
  <p>so i've edited the url with an "&amp;branch=$BITBUCKET_BRANCH" at the end, but it won't work.
  <a href="https://i.stack.imgur.com/ZiLZa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZiLZa.png" alt="The Jenkins job that was triggered and the attempt to echo the branch name"></a></p>
  
  <p>any ideas what should i do in order to send the webhook with the branch name?</p>
  
  <p>*******EDIT*******</p>
  
  <p>i saw that there is something called Bitbucket event payload.
  which is a json that contains all of the details about the webhook:
  <a href="https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html" rel="noreferrer">https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html</a></p>
  
  <p>but i can't figure a way how to use it and pull it's data from jenkins.</p>
  
  <p>i think that, this is the way to solve this, but i don't know how to use it.</p>