Connect Jira Cloud to GitHub

Still need help?

The Atlassian Community is here for you.

Ask the community

When your GtHub account is linked to Jira Software, your team gets to see their branches, commit messages and pull requests right in the context of the Jira Software issues they're working on. Read more in Streamlining your development with JIRA.

Connect a GitHub account to Jira Software

To connect your GitHub account to Jira Software, you use the DVCS Connector provided in Jira.

By the way, you'll need to have admin permissions on both Jira Software and on the GitHub account you want to link. 

There are just a couple of steps:

Step 1. Create an OAuth access token for your GitHub account

The DVCS Connector requires an OAuth access token, which you create in your GitHub account. You should create the access token in the GitHub account that owns the repositories you want to link. If you are linking repositories for a team, you should generate this token using the team account. 

Create the OAuth token as follows:

  1. Log in to GitHub as a user with admin permissions on the account.
  2. Choose Edit Your Profile
  3. Select OAuth Applications.
  4. Select the Developer Applications tab.
  5. Choose Register new OAuth application
  6. Enter a name for Application Name
  7. Enter the Jira Software URL for both the URL and Callback URL fields. Use lower case. Press Register Application.

    Make sure you enter the Jira Software Base URL (for example, https://myjiracloud.atlassian.net/) for both the Homepage URL and Authorization callback URL fields. Don't use the dashboard URL, such as https://myjiracloud.atlassian.net/secure/Dashboard.jspa

    See DCON-467 - Getting issue details... STATUS

    For Jira 6.2, the URL to use is https://myjiracloud.atlassian.net/plugins/servlet/oauth/authorize.

  8. Keep your browser open at your GitHub account while you go on with the next step.

Step 2. Add the OAuth token in Jira Software

After you create a key and secret in GitHub, you go back to Jira Software and enter the account, the OAuth key, and secret as follows:

  1. Log in to Jira Software as a user with admin permissions.
  2. From the Jira Software dashboard click the cog (settings) icon.
  3. Choose Applications.
  4. From the Integrations section on the left, choose DVCS accounts.
  5. Click Link Bitbucket Cloud or GitHub account.
  6. Choose 'GitHub' as the Host value.
  7. Enter a Team or User Account name.

  8. Copy the Client ID and Client Secret values from your GitHub site into the dialog.

  9. Leave the default auto link and Smart Commits (recommended) as is or change them:


     
  10. Click AddIf you get redirected to a blank page at this point, see DVCS connection to GitHub produces blank page.

  11. Grant access when prompted:



  12. When Jira connects successfully, you'll see your account on the 'DVCS accounts' page.

The account you just connected and all of its repositories appears in the 'Managed DVCS Accounts' page. The initial synchronization starts automatically. After that, the system continues to sync your repository automatically on a regular basis.

Connection notes

The connector does not automatically trust the key and secret. It asks you to authorize the DVCS connection using an account and password combination. The authorizing account need not be the account you used to create the key and secret, but it should have administrative access on all the repositories you want to link. 

When you link an account using the Jira DVCS Connector, the connector adds a post-commit web hook to all the repositories owned by the account in GitHub. When a commit happens, the DVCS Connector collects the commit message for processing.

On the Jira Software side, the repositories owned by your GitHub account appear on the 'DVCS accounts' page. A team member may create repositories under their individual GitHub account, but assign the team as the owner. These repositories also appear in the list.

After you link an account, Jira Software automatically starts looking for commits that reference issue keys. The summary shows the synchronization results and errors, if any. A synchronization of commit data from the GitHub repository to Jira Software can take some time. As the synchronization progresses, the commits appear in related issues. You can always enable and disable the linking of repositories with Jira Software as needed. 


Example of how commit information appears in a Jira Software project

When a developer makes a commit, they should add a Jira Software issue key to the commit message, like this:

git commit -m "PROJ-123 add a README file to the project."
git push origin <branchname>

Jira Software uses the issue key to associate the commit with an issue, so the commit can be summarized in the Development panel of the Jira Software issue.

See Integrating with development tools for more information.

Project permissions required

Project users must have the 'View Development Tools' permission to see commit information in the Development panel in a Jira Software issue. A Jira Software admin can edit a project's permission schema to grant this permission. See Managing Project Permissions.
Last modified on May 30, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.