It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Atlassian supported Jenkins integration for Bitbucket Server

(Update 27/Sep/2019 : This plugin is in beta now and the previously mentioned upcoming features are included in it.)

We’ve been building a plugin to integrate Bitbucket Server and Jenkins CI, and I’m excited to announce that our beta is ready to download and install. It lets you seamlessly configure a Jenkins job to clone/fetch from Bitbucket Server, removing the need for multiple plugins/apps to achieve the same workflow. To try it out you need Bitbucket Server 5.5+ and Jenkins 2.162+

We’re keen to hear your feedback, so comment with questions, feedback, and feature requests and we’ll get back to you. If you’re interested you can also contribute to our plugin.


Imran Khan

Product Manager - Bitbucket Server

Bitbucket Server Integration with Jenkins CI - plugin features

  • supports Jenkins freestyle job type

  • provides a simple way for you to connect your Jenkins CI to Bitbucket Server instance

  • securely manage credentials inside Jenkins for cloning from Bitbucket Server

  • automatically create a webhook inside a Bitbucket repo when a Jenkins job is saved

  • it supports Jenkins pipeline job type

  • select projects and repositories inside a Jenkins job through a dropdown

  • automatically send build statuses to commits and pull requests in Bitbucket Server

  • clone from Bitbucket Smart Mirrors without modifying the clone URL

If you’re ready to take it for a spin just follow the below steps:

Installing the plugin

  1. Download the HPI

  2. In Jenkins go to Jenkins > Manage Jenkins > Manage Plugins

  3. Select the Advanced tab

  4. Under Upload Plugin click Choose File

  5. Click Upload

Adding a linked Bitbucket Server instance


After installing the plugin you need to configure at least one Bitbucket Server instance. To do this:

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

  2. Under Bitbucket Server plugin click Add a Bitbucket instance

  3. Enter the instance details

Configuring the Jenkins job


  1. Go to the Source Code Management section of the Jenkins freestyle job and select Bitbucket
  2. Select the existing credentials or add new to authenticate with Bitbucket Server. The credential should be of the type Username with password
  3. Select the Bitbucket instance
  4. Enter the project key and repository slug
  5. In the Build Triggers select Bitbucket Server trigger build after push
  6. Configure rest of your build steps and save the job

When a new push happens the build will be triggered. You can then check the build info in Jenkins to see the changeset.


Does anyone know when this is likely to be available in the Atlassian Cloud?



Like Christopher Van Kemseke likes this
aneita Atlassian Team Sep 17, 2019

Hey @Lloyd Langley

Bitbucket Cloud can be configured to work with Jenkins today, using the Bitbucket plugin provided by Jenkins. 

I also want to share that Bitbucket Cloud has an inbuilt CI/CD tool with advanced capabilities, letting your team get all the benefits of CI without the overhead of maintaining an additional tool like Jenkins. You also won't need to worry about setting up any webhooks or configuring the two tools to work together. For more information, check out our docs


Like Benefic likes this

Hi @aneita,

Thnask for the notice.  it's hada 24k downloads but I haven;t found any comments on how good it is.... but don't worry.  It looks good and I hope to make use of it.

Best regards

@Lloyd Langley 

This is great news and I am super excited to dump all the other cumbersome  plugins that I have yet to get to work.  Is there a location I can go to to ask questions and provide feedback on this implementation?  I am currently trying to get this working and am not having much success

Imran Khan Atlassian Team Sep 30, 2019

Hi @Kevin Reynolds ,

You can post your feedback here or send email to ikhan at atlassian dot com. I'm keen to know what challenges you're facing. 

Happy to post here for any others who my be facing similar. 


BitBucket Server 6.6.2 running on Ubuntu 16.04 LTS

Jenkins 2.176.3 running in a docker container

Latest as of 9/30/2019 beta of the bitbucket addin for jenkins. 

I believe I have all the bits and pieces for the server connectivity configured fine as a connection test works fine.  

Create a webhook for when a push occurs. 

Push code to my repo but nothing happens on the jenkins side. 

If I examine the information for the hook it states a successful fire with a http status of 200

However looking at the response I see nothing in the body (not sure if there should be anything.)

A little confused as to where to go to look for potential problems as it looks like the the request was made correctly.  This should just work.  Please find attached some screen shots of the configuration.  sensitive information obfuscated. 

One thing in the jenkins log is an error with mirroring but as I understand it thats a datacenter feature not a server feature?bitbuckerServerPlugin.pngbuildTriggers.pngsourceCodeManagement.pngrequest.pngresponse.png

Sep 30, 2019 7:34:30 PM com.atlassian.bitbucket.jenkins.internal.scm.BitbucketMirrorHandler fetchRepositoriesQuietly
SEVERE: Failed to retrieve mirroring information for project DEVOPS-Docker and repo DevOps-Docker-Samples
com.atlassian.bitbucket.jenkins.internal.client.exception.BadRequestException: - response: 409

Kristy Atlassian Team Oct 01, 2019

Hi @Kevin Reynolds

It appears that you've selected the wrong trigger. You need to select "Bitbucket Server trigger build after push" to get the webhook created. The one that you've selected is not related to our plugin.


Gaurav Joshi Atlassian Team Oct 01, 2019

Hi @Kevin Reynolds

Please enable "Bitbucket Server trigger build after push" checkbox. The other setting "Build when changes are pushed to Bitbucket" belongs to a different plugin. This setting is necessary for the webhook callback to trigger the build on this project.

Also, ignore the Mirror handler exception. We will be fixing that in the subsequent release to not throw this exception. Your configuration should work properly. This exception has no effect on your configuration. 

Also, from beta 1, you don't have to manually add webhooks to bitbucket server. The plugin does that for you provided the "Bitbucket Server trigger build after push" checkbox is enabled.


Awesome! Yes that was it.  thank you it now works flawlessly.   Really excited about this and happy that Atlassian dove in head first rather than the normal model of leave it up to the marketplace.  This is a core competency that should be out of the box with bitbucket.  

Is there anywhere I can see implementation information?  For example I would like to integrate the trigger into my jenkinsfile for my projects so that I can extend my config as code CI/CD model here. 


I looked through the snippet generator and did not see anything that jumped out at me 

Kristy Atlassian Team Oct 02, 2019

Hi @Kevin Reynolds

The snippet generator should have a bbs_checkout step in there:

Screen Shot 2019-10-03 at 8.29.28 am.png


You should then be able to fill out all the derails and generate the snippet for your Jenkinsfile

Screen Shot 2019-10-03 at 8.30.33 am.png


Hope that helps,


Hi. What is the real reason of creation of this plugins? There is a very good working one, tested with real instances/workloads.

Why do we need another one?

And if this plugin doesn't have something you need, why not just contribute to this?

Thank you.

Yes!  I discovered that yesterday, thank you.  What I am still having trouble with and maybe I am just over complicating it?  I cannot figure out how to set the trigger value for the job in the in jenkins file.  Ie  I can create a multi project pipeline and get it to fire just fine manually, in addition I can fire a freestyle job with no issue from a push as well.  The problem is once a multi project pipeline is created there is no way to change and save the configuration, So I need to be able to set the trigger value in the jenkins file. trigger.png

^^^ this guy right here.  Am I just missing something? 


Thank you in advance.  You guys rock!

@Aliaksei Savanchuk Why shouldn't they?  I cant think of a better team to build the integration than the team that actually owns the application being integrated.   And besides not all teams or environments have or care to divert the resources to "just contribute to this"  I for one need a solid working solution for this.  And while I explored the tool you mention it was not working in my environment, the problem I was having got a lot of "shrugs" and I dont have time to dig into it.  This is basic functionality that should be part of the out of the box solution in the first place.   Just my humble 2cp.

@Kevin Reynolds 

I'm asking Atlassian developers here to understand their decision.

It doesn't seem smart, from my perspective, to create the same thing that already exists, making another open source out of the existing open source project, understanding that most of existing BitBucket Servers use bitbucket-branch-source. It's like if Microsoft would decide not to use Google Chromium for their new Edge but creating the other the same thing from zero.

Mikael Sandberg Community Leader Oct 03, 2019

Can this plugin be configured so that it triggers when a pull request is opened? Or is it only when a developer pushes to Bitbucket?

Gaurav Joshi Atlassian Team Oct 03, 2019

Hello @Mikael Sandberg, Triggering on pull request open is not available right now however we are considering adding it in a future version.


Like # people like this


Log in or Sign up to comment
Community showcase
Posted in Bitbucket

Share your software development horror stories!

Hey Community! I work on the Bitbucket product marketing team. With Halloween approaching, we wanted to discuss a topic tailor-made for October: development horror stories. Whether it was a lurk...

620 views 6 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you