Child pages
  • Bitbucket Cloud Build Status Notifier Plugin

Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Plugin Information

View Bitbucket Build Status Notifier on the plugin site for more information.

Every time you trigger a build, you don't have to log in to your build server to see if it passed or failed. Now you will be able to know when your build is passing right within the Bitbucket UI. 


Notify to Bitbucket Cloud for the following build events:

  • Build start
  • Build finish

This plugin aims at the Atlassian-hosted BitBucket Cloud solution, not BitBucket Server (formerly known as Stash).


Create a OAuth Consumer

First you need to get a OAuth consumer key/secret from Bitbucket.

  1. Login into your Bitbucket account.
  2. Click your account name and then in Settings from the menu bar.
  3. Click OAuth from the menu bar.
  4. Press the Add consumer button.
  5. The system requests the following information:
    1. Give a representative name to the consumer e.g. Jenkins build status notifier.
    2. Although is not used, a Callback URL must be set e.g.
    3. Leave blank the URL field.
    4. Add Read and Write permissions to Repositories.
    5. Click Save button and a Key and Secret will be automatically generated.

Ensure Jenkins URL is set

Second, ensure that Jenkins URL is properly set:

  1. Open Jenkins Manage Jenkins page.
  2. Click Configure System page.
  3. Go to the section Jenkins Location.
  4. Set the correct URL to Jenkins URL.
  5. Click Save button.

Add OAuth Credentials to Jenkins

Third, you need to add the Bitbucket OAuth Consumer credentials. You have two ways to configure it globally or locally:

  1. Open Jenkins Manage Jenkins page.
  2. Click Configure System.
  3. Go to the section Bitbucket Build Status Notifier plugin.
  4. If you still don't have stored the credentials click Add, otherwise you can skip this step.
    1. Select Username with password.
    2. Set the the OAuth consumer key in Username.
    3. Set the the OAuth consumer secret in Password.
    4. Click Add button.
  5. Select the desired credentials.
  6. Click Save button.
  1. Go to the Job you want notifies the builds to Bitbucket.
  2. Click Configure.
  3. Click Add post-build action.
  4. Select Bitbucket notify build status.
  5. Click Advanced button.
  6. If you still don't have stored the credentials click Add, otherwise you can skip this step.
    1. Select Username with password.
    2. Set the the OAuth consumer key in Username.
    3. Set the the OAuth consumer secret in Password.
    4. Click Add button.
  7. Select the desired credentials.

Pipeline Projects

Once you have configured the credential, you can notify BitBucket from your Pipeline script through the bitbucketStatusNotify step.


The bitbucketStatusNotify step notifies the status of a build identified by a build key and build name to BitBucket (see all options under API). If buildKey and buildName parameters are not provided, a standard name will be assigned to the build (NameOfYourJob #numberOfBuild - eg. MyProject #32).


bitbucketStatusNotify(buildState: 'INPROGRESS')

try {
  // do your job logic
} catch (Exception e) {
  bitbucketStatusNotify(buildState: 'FAILED')

bitbucketStatusNotify(buildState: 'SUCCESSFUL')



The bitbucketStatusNotifiy step allows the following parameters:








The status of the current build phase




The unique key identifying the current build phase




The build phase's name shown on BitBucket




The build phase's description shown on BitBucket

Freestyle Projects

Once you have configured the credentials, configure jenkins to notify Bitbucket.

  1. Go to the Job you want notifies the builds to Bitbucket.
  2. Click Configure.
  3. Select Bitbucket notify build status.
  4. Choose whether you want to notify the build status on Jenkins to Bitbucket.
  5. Choose whether given a same scm revision you want to notify a new build status for every job build or to override the latest one.

Change Log

Version 1.4.0 (May 29, 2018)
  • (plus) Add optional parameters for the bitbucket repo slug and the commit id. (PR #37)
Version 1.3.3 (Feb 15, 2017)
  • (error)  Fix bug on pipeline avoid exception whenever failure is notified.
Version 1.3.1 (Dec 20, 2016)
  • (plus) Add documentation for overriding latest build status
  • (plus) Folders/Multibranch support. Refactored all project.getFullDisplayName() calls to project.getFullName() calls in order to support job inside folders.
  • (error) Fix for username same as repository name
  • (plus) Use MercurialTagAction.class to retrive Mercurial revision
Version 1.3.0 (Juli 13, 2016)
  • (plus)   Add support for pipeline plugin. (JENKINS-33841)
  • (plus)   Add configuration for show only latest build status on Bitbucket. (JENKINS-35083)
Version 1.2.2 (Juni 16, 2016)
  • (plus)   Improve documentation.
  • (error)   Fix some issues related to plugin deployment.
Version 1.2.1 (Juni 1, 2016)
Version 1.2.0 (April 22, 2016)
  • (plus)   Add support for parameterized repository URLs. (JENKINS-33276)
  • (plus)   Add support for multi SCM.
Version 1.1.0 (March 13, 2016)
  • (plus)  Add support for updating the Bitbucket build status for a previous aborted build. (JENKINS-32940)
  • (error)  Fix bug build abortion not notified. (JENKINS-32940)
  • (plus)  Add support for single and global API credentials. (JENKINS-32574)
  • (error)  Fix bug max Bitbucker key lenght. (JENKINS-32781)
  • (plus)  Add support for mercurial repositories. (JENKINS-32548)
Version 1.0.3 (Jan 29, 2016)
  • (error)  Fix bug parsing repository URI. (JENKINS-32498)
  • (error)  Mark UNSTABLE builds as FAILED on Bitbucket.
Version 1.0.1 (Jan 22, 2016)
  • (error)  Fix problem finding current revision. (JENKINS-32519)
  • (plus)  Improve logging for exceptions in order to easy debugging.
Version 1.0 (Jan 15, 2016)


  1. Unknown User (qisylvia)

    Looks like this only applies to Bitbucket Cloud? Is there an equivalent plugin for Bitbucket Server? Thanks. 

  2. Unknown User (cansuerkal)

    Hello , 

    We need to show build status information in Bitbucket Server side. 

    Unknown User (qisylvia) also asked for Bitbucket Server. Could you help us to find equivalent plugin for Bitbucket Server? Thanks.


  3. Unknown User (newlix)

    You might be able to use the Stash Notifier for a Bitbucket server.

    I setup an update to Bitbucket Server using the REST API and an httpRequest in the groovy code using pipelines.

    Unfortunately, I no longer have access to the code.

  4. Unknown User (ben5556)

    When using bitbucketStatusNotify(buildState: 'SUCCESSFUL') in pipeline script, the plugin only updates Bitbucket build status if the option 'Build when a change is pushed to BitBucket' is enabled in the pipeline job. If the option is not checked nothing happens. EDIT: For the first run the option should be enabled to sort of enable the plugin I guess because on the 2nd run if i disable the option and run the pipeline it works as expected.

  5. Unknown User (tinyzimmer)

    When using the pipeline step from a shared pipeline library checked out from SCM (also in Bitbucket Cloud), the notifications get sent to the commit/project where the shared library resides, rather than the SCM configured for the main project being built. This one sounds like it might be a doozy.