title: Automatic merge in bitbucket after successful jenkins build
body: <p><strong>Current Setup</strong></p>
  
  <p>I use the Bitpucket multipipeline script for Bitbucket,
  When a Pull Request is created the jenkins build is triggered</p>
  
  <p>my Jenkins pipeline is currently as follows (for merges to development branch):</p>
  
  <ol>
  <li>checkout merged code</li>
  <li>build + run tests</li>
  <li>do some sonarqube analysis</li>
  <li>block if quality gate fails
  5a. check into nexus
  5b) (if it is a software to release, copy it to the server and roll it out automatically to the test server)</li>
  </ol>
  
  <p><strong>What I want</strong></p>
  
  <p>The final step I want is to automatically merge and close the PR when jenkins has approved. (In a later stage i want this only to happen on PR's from features to development, we will have a different procedure for release/production PR's). </p>
  
  <p>I see two possible solutions, either bitbucket has something built in so I can call the merge for the given PR from jenkins with a plugin in jenkins/add it to the Jenkinsfile</p>
  
  <p>or I have a Bitbucket plugin to automatically finalize the merge when jenkins approves (somehow)</p>
  
  <p>If you need any more information i will gladly provide it.</p>