Git Integration for Jira Cloud Documentation

Contact support
GitKraken Status  

GitHub Enterprise Server

These instructions apply to self-hosted GitHub Enterprise Server.

For instructions to instances hosted on GitHub.com (Free, Team, Enterprise (including EMU) plans), please go to this page.

Using Jira Server or Data CenterSee the corresponding article.

 

Integrate GitHub Enterprise Server with Jira Cloud

Quickly learn how to connect GitHub Enterprise Server git repositories via Git Integration for Jira Cloud.

What’s on this page:


Right click here to open this video in a new browser tab for more viewing options.

Creating a personal access token

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

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

Using Git service integration

This process requires an existing GitHub Enterprise Server account. 

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

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


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


  3. For the following screen, click GitHub Enterprise Server to start integration with this git service.


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


  5. For this guide, click on the PAT GitHub Server to select it.

    • We recommend the PAT integration for this git service. This uses personal access tokens to setup GHE integrations. Users will have to configure their own PAT from GHE to use for this setup.

    • For the Host URL, enter the address of the GitHub Enterprise Server.

    • For admins/owners, repository managers, collaborators or users that have enabled 2FA, enter the PAT on the Token field.

    • For GHE webhook indexing integration, see this article instead.

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

  6. Click Connect and select repositories to proceed to the next step. The Git Integration for Jira app will read all available repositories from your GitHub Enterprise Server account.

  7. The following screen is displayed.


    • Repositories that are added or removed from GitHub will be likewise connected or disconnected from Jira Cloud.

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

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

  8. Click Connect repositories to complete the setup.

GitHub Enterprise Server repositories are now connected to Jira Cloud.

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 Enterprise Server git repository. Look for the the repository clone URL on the repository project page.

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

Single git repository integration (HTTPS)

Setting up GitHub Enterprise Server permissions

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

Assign GitHub Enterprise Server 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 Enterprise Server account.

  2. Go to profile icon 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:

    1. Set desired Role for this member.

    2. Convert this member to outside collaborator.

    3. Give this member access to organization repositories.

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

  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 Enterprise Server

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

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

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 GitHub repositories will have their names attached with a GitHub organization 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. To configure default repositories for more than one Jira project – use the User settings page.

  2. Choose a Base branch.

    OPTIONAL  Designate the branch to be the default selected branch for the active 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).

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 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 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 GitHub repositories will have their names attached with a GitHub organization 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. 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 active 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).

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.

More Integration Guides

GitHub.com (Git Integration for Jira Cloud)

GitHub Enterprise Server (this page)

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 (Git Integration for Jira Cloud)

Introduction to Git integration (Git Integration for Jira Cloud)

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