Git Integration for Jira Cloud Documentation

Contact support
GitKraken Status  

Bitbucket Cloud

Using Jira Server or Data Center? See the corresponding article.

 


 

Integrate Bitbucket Cloud with Jira Cloud

Quickly learn how to connect Bitbucket Cloud git repositories via Git Integration for Jira Cloud app.

What’s on this page:


Permissions

Set Bitbucket Cloud permissions according to your organization’s rules. Viewing commits from Jira requires at least Read or View repository permissions. For branch/merge request creation, set specific service users with Write permissions.

Using Git service integration

We recommend using the Git service integration setup to connect multiple repositories from your Bitbucket Cloud account.

  1. On your Jira Cloud dashboard menu, go to Apps ➜ Git Integration: Manage integrations.


  2. On the Manage integrations page, click Add integration.


  3. For the following screen, click Bitbucket.org to start integration with this git service.


  4. The following screen is displayed.


    • Configuring the Advanced settings is optional. However, admins/power users may set how the project listing is displayed.


      • Custom API Path  –  this is a relative path that starts with “/”. The integration will use the relative REST API path to retrieve the list of tracked repositories. The maximum allowed length is 2000 characters or less.

        To learn more examples, see article Jira Cloud: Working with Custom API Path.

      • JMESPath filter  –  JMESPath is a query language for JSON used to filter API results and to limit which repositories are integrated. The maximum allowed length is 2000 characters or less.

        Read about JMESPath expressions on their website. For help with writing expressions, please contact support.

        To learn more examples, see article Jira Cloud: Working with JMESPath Filters.

    • While Custom API Path and JMESPath filter are mutually exclusive, you can use one, the other, both or neither.

  5. Click Connect to proceed.

  6. Login to your Bitbucket Cloud account if prompted. If 2FA is enabled for your account, enter the code and continue.


  7. Grant OAuth access for Git Integration for Jira Cloud app when prompted.

  8. On the repository selection screen, feel free to choose repositories to use for this integration. You may use the Connect all… option to mark all repositories in the list.


  9. Click Connect repositories to complete this setup.

The Bitbucket Cloud repositories are now connected to Jira Cloud.

Single repository connection


Obtain the repository URL from the Bitbucket Cloud repository project page. Choose between SSH or HTTPS.

  1. On your Jira dashboard menu, go to Apps ➜ Git Integration: Manage integrations.

  2. Click Add integration.

  3. At the bottom section on the following screen, enter the git clone URL in the provided box.


  4. Click Connect to proceed.


  5. Enter Username and Password. If 2FA is enabled, enter PAT on the password field.

  6. Click Add integration to complete this process.

The repository is now connected to Jira Cloud.

Viewing git commits in Jira Cloud

  1. Perform a git commit by adding the Jira issue key in the commit message.  This will associate the commit to the mentioned Jira issue.
  2. Open the Jira issue.
  3. Scroll down to the Activity panel then click the Git Commits tab.
  4. Click View Full Commit to view the code diff.

For more information about this feature, see Documentation: Linking git commits to Jira issues.

Working with branches and pull requests with Bitbucket

The Git Integration for Jira Cloud app adds two features on the Jira issue developer panel – Create Branch, and Create Pull/Merge Request. For more information about the developer panel, see the Jira Git development panel documentation.

This process requires a Bitbucket Cloud git repository. An app password is optional for access, but not required.

For Workspace users, the user must have the Write permissions.

Default Branch

Most git integrations allow changing of the default branch of the repository/project other than “master”. This change is reflected in the  Repository Settings of the Git Integration for Jira app on the next reindex. Full feature integrations support this function where Git Integration for Jira app gets the default branch from almost all integrations and apply this setting at repository level.

Main branch for repositories within an integration can only be changed on the git server.

Creating branches

On your Jira Cloud, open a Jira issue. On the Jira Git integration development panel, click Open Git Integration then click Create branch. The following dialog is displayed.

Pointers:

  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.

    • If there are several repositories with the same name, the listed Bitbucket repositories will have their names attached with a Bitbucket workspace name. For example, workspace01/revision-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. To configure default repositories for more than one Jira project – use the User settings page.

  2. Choose a Source branch. OPTIONAL Designate the branch to be the default selected branch for the currently selected repository. To configure default branches for more than one repository – use the User settings page.

  3. Enter a Branch name or leave it as is (recommended).

  4. lick Create branch to complete this process.

For more detailed information on this feature, see Create branch.

The newly-created branch is now listed in the developer panel under Branches. Perform a commit to the newly-created branch to be ready for merge.

Creating pull/merge requests

The pull request feature works the same as merge request. On your Jira Cloud, open the Jira issue where your previously created a branch. On the developer panel under Open Git Integration, click Create pull request. The following dialog is displayed.

Pointers:

  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.

    • If there are several repositories with the same name, the listed Bitbucket repositories will have their names attached with a Bitbucket workspace name. For example, workspace01/revision-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. To configure default repositories for more than one Jira project – use the User settings page.

  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. To configure default branches for more than one repository – use the User settings page.

  3. Set master 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/merge requests are still indexed based on branch name even if the PR/MR 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 master).

For more detailed information on this feature, see Create pull/merge request.

Pull/merge requests are still indexed based on branch name even if the PR/MR title does not have the Jira issue key – as long as the branch name contains the Jira issue key.

The pull request is listed on the developer panel of the Jira issue page.

The pull request is also ready for approval by the reviewers in your GitHub web portal.

Access the Create branch and Create pull/merge request features in the Jira issue developer panel. For more information, see Jira Git integration development panel.

 

More Integration Guides

GitHub.com (Git Integration for Jira Cloud)

GitHub Enterprise Server (Git Integration for Jira Cloud)

GitLab.com (Git Integration for Jira Cloud)

GitLab CE/EE (Git Integration for Jira Cloud)

Azure DevOps | Visual Studio Team Services (VSTS) (Git Integration for Jira Cloud)

Azure DevOps Server | Team Foundation Services (TFS) (Git Integration for Jira Cloud)

AWS CodeCommit (Git Integration for Jira Cloud)

Gerrit (Git Integration for Jira Cloud)

Bitbucket Cloud (this page)

Introduction to Git integration (Git Integration for Jira Cloud)

Have feedback about this article? Did we miss something? Let us know!
On this page