Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Save Developers Time and Increase Your Project Visibility by Integrating Jira and Bitbucket

Good admins help their teams find tools that make their processes easier. Great admins help their teams integrate their tools for elevated productivity, collaboration, and speed.  

 

Integrating Bitbucket and Jira can provide numerous benefits for dev teams and Jira administrators.

Devs- Integrating Bitbucket and Jira through this app eliminates the need for constant context switching between tools, allowing them to track code changes and work items in one central location. This can lead to improved collaboration among team members and foster better communication.


Admins- Gain increased visibility on the status of key projects allowing them to make more informed decisions, Having access to real-time information on code changes also allows admins to more accurately estimate lead times and set realistic deadlines.

 

Connect Bitbucket with Jira 

We recommend creating a Bitbucket user specifically for the integration. This way, the Bitbucket user can have defined permissions to perform given tasks. Ensure this user has access to the repositories that you wish to integrate with Jira.

To continue your Bitbucket Jira integration, you’ll need to install Git Integration for Jira from the Atlassian marketplace. Like all Atlassian marketplace apps, you’ll need a Jira administrator to install the app. Once you have Git Integration for Jira installed, you can begin connecting your Bitbucket repositories with the associated Jira projects. 

  1. From the top navigation bar in Jira, select Apps and then Git Integration: Manage integrations
  2. Select Add Integration button on the top right
  3. From the Select Git hosting service page, select Bitbucket.org for cloud.
  4. Select Bitbucket OAuth integration type and click Connect Bitbucket
  5. You can connect all repositories or select individual repositories by expanding the workspace.

At this point, the app will index your repositories and make them available to be viewed in Jira.

Linking Bitbucket with Jira Issues

To create a link between a Git commit and a Jira issue, developers must include the Jira issue key in their commit message. 


Example Git commit message: GIT-4322 – Updated the plugin

In this example above, GIT-4322 is the Jira issue key linking the commit message to the Jira issue. Commits that are part of non-main branches will be included only if the main branch doesn’t have them.

Pro Tip: When working with a sub-task, put the parent and sub-task Jira issue keys in the commit message so that the commit shows in both places. This way, the commit for the sub-task does not get lost in the many commits of the parent issue.


Create Bitbucket Branch in Jira

On your Jira Cloud instance, open a Jira issue. On the Jira Git integration development panel, click [Open Git integration] then click [Create branch]. This will open a dialog box where the branch can be created.

  1. Select a Repository from the list.
    • The git host service logo is displayed for all the repositories in the dropdown list to easily identify which git service they belong to.
    • If there are several repositories with the same name, the listed Bitbucket repositories will have their names attached with the owner name. For example, johnsmith/second-webhook-test-repo.
    • Use the search box in the dropdown list to filter displayed repositories.
    • *Optional- Designate the repository to be the default selected repository for current Jira project. 
  2. Choose a Source branch.
    • *Optional- Designate the branch to be the default selected branch for the currently selected repository.
  3. Enter a Branch name or leave it as is (recommended).
  4. Click [Create branch] to complete this process.

 
The newly-created branch is now associated with that Jira issue listed in the development panel under Branches. Perform a commit to the newly-created branch to be ready for merge.

Create Bitbucket Pull Request in Jira

To create a pull request from a Jira issue, open the desired Jira issue, click Open Git integration then click Create pull request. This will open a dialog box where the merge request can be made.

  1. Select a Repository from the list.
    • The Git host service logo is displayed for all the repositories in the dropdown list to easily identify which git service they belong to.
    • If there are several repositories with the same name, the listed Bitbucket repositories will have their names attached with a Bitbucket group name. For example, BigBrassBand/second-webhook-test-repo.
    • Use the search box in the dropdown list to filter displayed repositories.
    • *Optional- Designate the repository to be the default selected repository for current Jira project. 
  2. Choose the newly-created branch as the Source branch.
    • *Optional- Designate the branch to be the default selected branch for the currently selected repository.
  3. Set main as the Target branch.
  4. Enter a descriptive Title or leave it as is (recommended).
  5. Click Create pull request to complete this process. Follow the link to the PR to setup for review and approval.

Pull requests are still indexed based on branch name even if the PR title does not have the Jira issue key – as long as the branch name contains the Jira issue key. Preview allows you to see the comparison view of the current changes in the selected Source branch vs Target branch (usually main).

Jira Bitbucket Webhooks

By default, repositories are reindexed on a fixed interval. If you want Jira to reflect Bitbucket updates in real time, you must set up Webhooks. To add webhooks to your connected Bitbucket repositories, complete the following steps. 
 

  1. In Jira, select Apps from the top navigation bar and then Indexing triggers. Enable Indexing triggers.
  2. Go to Manage integrations on the left panel
  3. Select the Bitbucket integration you wish to add webhooks to
  4. On the left, select Feature Settings
  5. Copy the URL under Indexing triggers

Next, you'll need to go to Bitbucket to finish the integration.

  1. In Bitbucket, from your project select Settings and then Webhooks
  2. Paste in the URL you copied previously
  3. Under Trigger, select Push events, Pull request events, and Enable SSL verification
  4. Select Add webhook

Your webhook is now created. Commits, branches, and merge requests that are associated with a Jira issue will now be visible in Jira issues in real-time.

Integrate Jira and Bitbucket Today

Start a free trial of Git Integration for Jira. Your developers will love the time it saves them and you will appreciate the visibility it affords you.

Want to take your Jira Bitbucket integration to the next level? See how you can start leveraging Jira Smart Commits to perform actions in Jira like making a comment or record time tracking using just your Git commits.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events