Jenkins : Bitbucket Server integration plugin for Jenkins

This plugin is in beta

If you have feedback feel free to leave a comment on this Atlassian Community blog post. You can also raise any issues on using the component atlassian-bitbucket-server-integration-plugin.


The Bitbucket Server integration plugin is the easiest way to connect Jenkins to Bitbucket Server. With a few simple steps you can configure it to:

  • Automatically create webhooks in Bitbucket to trigger Jenkins builds

  • Allow Jenkins to clone/fetch from Bitbucket to run the builds

It streamlines this entire process, removing the need for multiple plugins to achieve the same workflow.

The plugin enables this in two ways. It adds a Bitbucket Server Source Code Manager (SCM) to Jenkins, making it easy to set up a connection to a Bitbucket Server repository when setting up a Jenkins job. It also adds a build trigger to Jenkins that automatically creates a webhook against Bitbucket Server that triggers the Jenkins job on relevant pushes.

Plugin features

This beta features:

  • Support for Jenkins Freestyle projects

  • Secure credential management in Jenkins for cloning from Bitbucket Server

  • Automatic webhook creation in a Bitbucket Server repo when a Jenkins job is saved
  • Support for Jenkins Pipelines

  • Quick selection of Bitbucket Server projects and repos for a Jenkins job through a dropdown

  • The ability to automatically send build statuses to Bitbucket Server

  • Cloning from Bitbucket Server Smart Mirrors with no need to modify the clone URL

Using the plugin

This wiki covers:

  • Adding Bitbucket Server instance details to Jenkins

  • Creating a job in Jenkins

Adding Bitbucket Server instance details to Jenkins

Bitbucket Server instances are added and configured at the system level. Once they’re added users can select them from the SCM when creating a Jenkins job. You must add at least one Bitbucket Server instance to Jenkins.

When adding a Bitbucket Server instance you must add at least one Bitbucket Server personal access token. Doing this allows users to automatically set up build triggers when creating a Jenkins job. For this to work the tokens you add must have project admin permissions.

In addition, you can add Bitbucket Server credentials (in the form of username and password) to make it easier for users to set up Jenkins jobs. Users will be able to choose from these credentials to allow Jenkins to authenticate with Bitbucket Server and retrieve their projects.

To add a Bitbucket Server instance:

  1. In Jenkins go to Jenkins > Manage Jenkins > Configure System.

  2. Under Bitbucket Server plugin click Add a Bitbucket instance.

  3. Enter instance details.

  4. Click Save.

Creating a job in Jenkins

Once you’ve added a Bitbucket Server instance to Jenkins users will be able to select it when creating a job, which will make it easier for them to select the repo to be cloned. They’ll also be able to select the Bitbucket Server build trigger to automatically create a webhook.

To create a Jenkins job:

  1. Select the Source Code Management tab.

  2. Select Bitbucket Server.

  3. Enter the details of the job.

  4. Under Build Trigger select Bitbucket Server Trigger

  5. Add a build step

  6. Click Save.


1.0-rc-1 (10 October 2019)

  • First stable release candidate for the upcoming 1.0 release.
  • Global Credentials and Admin token are now tracked. 
  • Few minor bug fixes. 

1.0-beta-4 (8 October 2019)

  • Bug fixes related to mirror cloning and pipeline.

1.0-beta-1 (27 Sep 2019)

  • Jenkins Pipelines are now supported
  • You can now clone from Bitbucket Server Smart Mirrors without modifying the clone URL

1.0-alpha-3 (18 Sep 2019)

  • Webhooks are now created in Bitbucket Server automatically when configuring the SCM
  • Bitbucket SCM storage fields have changed so will require re-creating jobs that use Bitbucket SCM
  • Project and repo fields when configuring the SCM are now searchable dropdowns
  • Build status is now posted to Bitbucket Server after starting and completing a build

1.0-alpha-2 (23 Aug 2019)

  • Bugfix: Last entry in server configuration can now be removed
  • Minor changes and fixes

1.0-alpha-1 (7 Aug 2019)

  • First public release