JIRA comes with a built-in functionality to connect with Bitbucket and GitHub repositories. Perform these steps to integrate JIRA into Bitbucket and GitHub:
Navigate to JIRA Administration | Add-ons | DVCS Accounts.
On the next screen, click on the Link Bitbucket or GitHub account button:
In the popup that appears, select either Bitbucket or GitHub from the Host drop-down list, enter your username in the Team or User Account text field, and enter OAuth Key and OAuth Secret, both of which you can generate from your Bitbucket or GitHub account. Click on the Add button to continue:
After the configuration is complete, the JIRA instance will list the available repositories:
Once the repositories are listed in the instance, the Git commit messages can include the JIRA issues ID and these files will be displayed in the JIRA view issue Source tab.