Bitbucket Integration Guide | PagerDuty

Integration Guide for Bitbucket

Bitbucket + PagerDuty Benefits

  • Bitbucket is Atlassian’s Git solution for professional teams, featuring pull requests, branch permissions and inline comments.
  • Notify on-call engineers about failures within your Bitbucket pipelines.

Requirements

  • In PagerDuty: This integration requires a Manager base role or higher to configure.
  • In Bitbucket: This integration requires users to be able to edit repository settings.

How it Works

  • When there is a failure in your Bitbucket pipelines, a PagerDuty incident will notify on-call responders.
  • When the failure recovers, a SUCCESSFUL message is sent to PagerDuty and the PagerDuty incident will automatically resolve.

Version

This integration is intended for Bitbucket Cloud.

Integration Walkthrough

In PagerDuty

  1. In the PagerDuty web app, go to Services Service Directory.
  2. Select the PagerDuty service you wish to integrate with, then select the Integrations tab.
  3. Click Add an integration.
  4. Search for and select Atlassian Bitbucket Pipelines, then click Add.
  5. You will be taken back to the Integrations tab showing the newly added integration. Click the name of the Atlassian Bitbucket Pipelines integration you created in the previous step.
  6. Click to copy the Integration URL to your clipboard, which will be in the following format: https://events.pagerduty.com/integration/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/enqueue. Keep this URL in a safe place, since you will need it in the next section when you configure a webhook in your Bitbucket account.
Copy integration URL

Copy integration URL

In Bitbucket

You will complete the rest of the configuration in Bitbucket, where you will add a webhook that sends build information to PagerDuty.

  1. Open the repository you want to integrate with PagerDuty. From the left-side navigation, select Repository settings.
  2. Select Webhooks from the Workflow subheading and click Add Webhook.
  3. Enter a title, then paste the PagerDuty URL you copied from the previous section into the field URL.
  4. In the section Triggers, select Build status updated under Repository.
Configure webhook

Configure webhook

  1. Click Save.
  2. Optional: Each repository in Bitbucket can be configured to send failure information to a different PagerDuty service. You can repeat the Integration Walkthrough as many times as needed, if you’d like to integrate PagerDuty with more than one Bitbucket repository.