Recipe 1.10 Integrate JIRA Cloud with GitHub
Problem
You wish to integrate a GitHub repository with JIRA Cloud.
Solution
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.
Log in to GitHub as a user with admin permissions on the account.
Choose Edit Your Profile.
Select OAuth Applications.
Select the Developer Applications tab.
Choose Register new OAuth application.
Enter a name for Application Name.
Enter the JIRA Software URL (e.g. https://myjiracloud.atlassian.net/) for both the URL and Callback URL fields. Press Register Application.
Keep your browser open at your GitHub account while you go on with the next step.
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:
Log in to JIRA Software as a user with admin permissions.
From the JIRA Software dashboard click the cog (settings) icon.
Choose Applications.
From the Integrations section on the left, choose DVCS accounts.
Click Link Bitbucket Cloud or GitHubaccount.
Choose 'GitHub' as the Host value.
Enter a Team or User Account name.
Copy the Client ID and Client Secret values from your GitHub site into the dialog.
Leave the default auto link and Smart Commits (recommended) as is or change them:
Click Add. If you get redirected to a blank page at this point, see DVCS connection to GitHub produces blank page.
Grant access when prompted:
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.
Discussion
To ensure that the commits to GitHub are associated with the relevant work item add the below to all commit messages.
<Work item ID> <Commit message>
e.g.
PROJ-123 Refactor of the module