Git Integration for Jira Cloud Documentation

Contact support  

GitHub.com

These instructions apply to instances on Free, Team, Cloud Enterprise (including EMU) plans hosted on GitHub.com.

For instructions on self-hosted GitHub Enterprise Server, please see this page.

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

GitHub Banner logo

Integrate GitHub.com with Jira Cloud

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

What’s on this page:


Right click here and open this video in a new window/tab for more viewing options.
(Updated video coming soon)

Creating a personal access token

If two-factor authentication is enabled for your GitHub account, you will need to create a personal access token (PAT) to access your git repositories. Enable two-factor authentication in your GitHub.com account for increased security.

While instructions from GitHub works just fine, please follow this article for a quick step-by-step guide to get you started.

Using Git service integration

This process requires an existing GitHub git repository. A GitHub account with enabled two-factor authentication and configured personal access token is encouraged.

We recommend using the Git service integration panel to connect multiple repositories from your GitHub.com account.

On November 13, 2020, GitHub.com is going to stop allowing API authentication via username/password. For more information, see GitHub.com – Deprecating Password Authentication.

We strongly recommend to use personal access tokens for GitHub.com account integration.

  1. On your Jira dashboard menu, go to AppsGit Integration: Manage integrations.

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

  3. On the following screen, click on the Git service integration panel for your integration type.

  4. Select GitHub.com from the list then click Connect … 

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

      • Custom API Path  –  his 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.

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

  5. Login to your GitHub account when prompted. When connecting to GitHub.com using OAuth for the first time, the user will be presented with a grant authorization screen.

    • Grant organization access to an org to also have its repositories listed in the Manage repositories page.

    • Below are the differences between the three authentication options for GitHub:

      Authentication Method       When are org repositories connected?
      ----------------------------------------------------------------------------
      OAuth                       User should notice and press the "Grant" button
                                  near the org repositories to connect them.
      
      PAT                         Org repositories are connected immediately.
      
      Username/Password           Org repositories are connected immediately.
    • Click Authorize BigBrassBand to continue.

  6. The following page is displayed.

    1. The Git Integration for Jira app will read all available repositories from your GitHub account.
      Repositories of the logged-in GitHub user can be automatically connected to Jira Cloud. Repositories that are added or removed from GitHub will be likewise connected or disconnected from Jira Cloud.

    2. Use the search options to filter displayed repositories for the current screen.

    3. Connect all repositories and organizations or select specific repositories to connect for this integration.

  7. Click Connect repositories to complete this setup.

The GitHub.com repositories are now connected to Jira Cloud. There will be a slight delay in adding 2FA-enabled repositories compared to others. These will show in the git configuration list eventually.

Single git repository integration

This section is for users who are using SSH connections or those who wanted to only connect a single specific repository.

This process requires an existing GitHub git repository. Look for the the GitHub repository URL on the repository project page. Choose between SSH or HTTPS.

Use this information to connect the GitHub git repository to your Jira Cloud via Git Integration for Jira app:

Single git repository integration (HTTPS)

Single git repository integration (SSH)

Setting up GitHub permissions

We recommend using a "service user" in GitHub (example: "Git-Integration-for-Jira") to be used to integrate GitHub with the Git Integration for Jira app. This dedicated "service user" will allow the GitHub administrator to set permissions so the app clones only the desired repositories.

Assign GitHub permissions for team members or collaborators to allow which resources are accessible for service users. This feature is only available in a GitHub Organization.

Default repository permission

  1. Login to your GitHub.com account.

  2. Go to Profile ➜ Settings.

  3. On your sidebar, click Organizations.

  4. Click Settings for the selected organization.

  5. On your sidebar, click Member Privileges. The following screen is displayed.

  6. Under the Base permissions, click on the dropdown button.

    • Choose the base permission level for organization members. The base repository permission only applies to organization members and not to outside collaborators. If the base permission is set to None, organization members will need to be given access to repositories using the Teams or Collaborators methods (see below).
  7. Save the changes.

For more information, see Access Permissions on GitHub ».

Teams and collaborators

To give a member additional access, they must be added to a team or make them collaborators on individual repos.

Set default repository permission for the current team:

  1. Open an organization team. (Your org ➜ Teams ➜ scroll down to the bottom then click the desired team.)

  2. Click the Repositories tab.

  3. Set ReadWrite or Admin repository access as desired.

Assign members to a team on your GitHub repository:

  1. Create a team in your GitHub Organization.

  2. Invite a member to add it into the team. An email invitation is sent to that GitHub service user.

    The service user is then added to the team if the invitation has been accepted.

  3. Click the service user to manage permissions for this member to:

    • Set desired Role for this member.

    • Convert this member to outside collaborator.

    • Give this member access to organization repositories.

    • Remove this member from the team.

  4. Click Manage access to manage repository access for this member.

Organization Permissions
While users have configured PAT for repository access, users in a GitHub Organization must at least have Read permissions. This allows them to view commits and smart commits (if enabled) of connected GitHub Organization repositories inside Jira.

GitHub Organization
For collaborators and commit authors, set these users to have Write permissions. This will allow them to view commits and smart commits, browse repositories and also enables them to create branches and pull requests to specified GitHub git repositories via developer panel of a Jira issue.

For more information on organization teams, see GitHub: Organizing Members into Teams ».

For more information on inviting collaborators, see Inviting Collaborators to a Personal/Organization Repository ».

Setting up GitHub web links

The Git Integration for Jira app automatically configures web linking for GitHub git repositories.

For single repository connections, web link setup is optional. However, git links will become available in Git Commits tab when configured.

For more information on this feature, see Documentation: Web linking.

Viewing git commits in Jira Cloud

  1. Perform a git commit by adding the Jira issue key in the commit message. This action will associate the commit to the mentioned Jira issue.

  2. Open the Jira issue in your Jira instance.

  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 GitHub

This process requires a GitHub git repository and a PAT with repo scopes.

For GitHub Organization, the user must have the Write permissions and the repo PAT scopes.

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.

    1. The git host service logo is displayed for all the repositories in the dropdown list to easily identify which git service they belong.

    2. If there are several repositories with the same name, the listed GitHub repositories will have their names attached with a GitHub organization name. For example, BigBrassBand/second-webhook-test-repo.

    3. Use the search box in the dropdown list to filter displayed repositories.

    4. 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. Click 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 Jira developer panel under Branches. Perform a commit to the newly-created branch to be ready for merge.

Creating pull 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.

    1. The git host service logo is displayed for all the repositories in the dropdown list to easily identify which git service they belong.

    2. If there are several repositories with the same name, the listed GitHub repositories will have their names attached with a GitHub organization name. For example, BigBrassBand/second-webhook-test-repo.

    3. Use the search box in the dropdown list to filter displayed repositories.

    4. 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.

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.

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