Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andykuszyk/4fe9edf662a41d09c7e7 to your computer and use it in GitHub Desktop.
Save andykuszyk/4fe9edf662a41d09c7e7 to your computer and use it in GitHub Desktop.
Integrating BitBucket with JIRA in the cloud

Integrating BitBucket with JIRA in the cloud

Introduction

BitBucket and JIRA can be integrated such that JIRA issues display a development panel that allows you to create branches and pull requests and which can display commits that relate to that issue.

In order to setup this integration, a number of steps need to be followed that are widely documented, especially by Atlassian. I'm just noting down some of the perculiarities that helped me to get this setup.

Setting up POST services in BitBucket

In order for JIRA to remain up-to-date with BitBucket when things change in a repo, your repo needs to have two POST services configured. These are normally added automatically when you link a JIRA account with a BitBucket account, but if not:

POST service:

https://[accountname].atlassian.net/rest/bitbucket/1.0/repository/[repo-id]/sync

Pull Request POST service:

https://[accountname].atlassian.net/rest/bitbucket/1.0/repository/[repo-id]/sync

These two services will mean that BitBucket will notify JIRA whenever things change in the repo that should be displayed on issues.

Discovering repo ids

Part of the url that needs to be provided to BitBucket is the repo or project id, which is the unique identifier that JIRA has for the BitBucket repo.

This needs to be discovered by querying JIRA:

https://[accountname].atlassian.net/rest/bitbucket/1.0/repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment