Alcide Rapid 7 Logo Alcide Rapid 7 Logo
Alcide has been acquired by Rapid7- a leading provider of security analytics and automation. Learn more

How to Configure Jenkins BitBucket Branch Source Plugin?

July 24, 2018
In case your Git repo resides in Bitbucket and Jenkins is your favourite butler, you’ve come to the right place.




There is a great plugin out there that helps connecting Jenkins to your Bitbucket account called Bitbucket Branch Source Plugin.
This plugin comes really handy especially if your project has multiple branches. In Jenkins lingo “Multibranch Project”.

Let’s go over the plugin installation and configuration:

  • Go to “Manage Jenkins” “Manage Plugins” then search and install the following:

  • Once installed, you should see the following option when creating a new Jenkins project: 

  • Select it and give your project a name.
  • The project settings screen will open:


You’ll need to configure a username/password credentials in Jenkins (beforehand) which will allow the plugin to scan for Bitbucket repositories.

The “Owner” field should be filled with your Bitbucket project ID. I was able to find it by clicking on my Bitbucket profile and then on “Teams”


Now check your browser URL to get your account ID:


In our case the ID is alcideio

As for the “Behaviors” section, we find “Discover pull requests from origin” and “Merging the pull request with the current target branch revision” to work best for our multibranch use case. By using this method combined with Bitbucket “Merge Checks” 

We assure that any pull requests are built and merged locally (on one of Jenkins slaves) with the master branch before allowing it to merge on the remote repo.

And now for a small but very annoying Gotcha…

In case you’ve got a project in Jenkins named “MY/PROJECT” (notice the slash). You may have encountered an issue where links like:


are broken when accessed directly via the old Jenkins UI.
Here at, we have seen this happening while using BlueOcean combined with Apache-Tomcat and Bitbucket Branch Source Plugin.

In order to fix that all you have to do is add the following to your file (if using Bitnami Jenkins it should be under /opt/bitnami/apache-tomcat/conf/

# Custom modification - This should fix blueocean broken links

Now restart Apache and you should be good to go.
Hope this helps.


Top 4 DevOps Tools ebook

Subscribe for updates, fresh insights, stories and tips

The latest posts delivered to your inbox