A jenkins build is triggered when a user creates a pull request on Bitbucket. The user waits for the result of this build. When the build is completed, the result of this build is notified back to Bitbucket server through bitbucket server notifier plugin. Now, if the build is successful, the user should be able to merge otherwise the merge should be blocked (or the merge button should be disabled). In other words, whenever the pull request is created the merge button should remain disabled unless the build is successful.
How can i achieve this ? Thanks