3

I would like to include link my pull requests to Jira ticket automatically like this: enter image description here

I have already prepend JIRA-Id in my pull request title, same goes for the source branch name. However, it did not link. I read from some article that I may need to include JIRA-Id in my commit messages as well. But one of my previous Jira ticket, I did not do so but it managed to link. Why is that so?

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
chiaDev
  • 389
  • 3
  • 17
  • What plugin are you using? Yes, general option is including issue id or issue key in the commit message. – stuck Jan 27 '22 at 16:54

2 Answers2

1

Suggestion to have your your branch and commit message include the JIRA-ID.

E.g.

  • Branch: bugs/JIRA-001
  • Commit message: "JIRA-001: Fix something in my project"

Check if your Bitbucket already linked to your Jira:

https://support.atlassian.com/bitbucket-cloud/docs/connect-bitbucket-cloud-to-jira-software-cloud/

  • Click your profile avatar > select a workspace from the Recent workspaces list or select All workspaces to display an entire list from which you can select.
  • Once you’re in your workspace, click Settings on the left sidebar menu.
  • Click Jira under Atlassian Integrations.
  • Choose the Jira Cloud instance you want to integrate with your Bitbucket Cloud workspace and click Connect.
  • Click Grant access to grant Jira Software access to your Bitbucket Cloud workspace.
  • Click Grant access to grant Bitbucket access to Jira.
  • Choose whether or not you would like to automatically sync and enable Smart Commits for all your repositories. Note: These options are selected by default. See Processing Jira issues with Smart Commits for more information. You can manage these settings later from the 'DVCS accounts' page in Jira Software.
  • Click OK.

And this is how to integrate with GitHub

https://support.atlassian.com/jira-cloud-administration/docs/integrate-with-github/

  • Install the (free) GitHub for Jira app from the Atlassian Marketplace and follow the instructions to complete the installation.
  • Select Get started to go to the GitHub configuration page (or go to Apps > Manage apps and select Configure integration in the GitHub menu).
  • Select Connect GitHub organization.
  • Find the GitHub organization you want to integrate with and select Connect, or select Install GitHub for Jira on a new organization to install the GitHub for Jira app on another GitHub organization.
  • Back on your GitHub configuration page, select Connect GitHub organization again and click Connect next to the organization you want to connect to your Jira site.
  • I tried to have both but sometimes, my PR still does not get linked. – chiaDev Feb 09 '22 at 10:28
  • Do you have Bitbucket linked to your Jira? –  Feb 10 '22 at 12:23
  • how can i check that? BTW, I am using GitHub. – chiaDev Feb 16 '22 at 01:54
  • I have edited the answer to include the link to the guideline, or you can follow the following steps to check and link bitbucket to Jira. In case of you want to link Bitbucket Server to Jira Cloud or Bitbucket Cloud to Jira Server, there other links inside that link can take you to the guideline as well. Good luck. –  Feb 16 '22 at 02:53
  • @chiaDev I just modified my answer again to include the link/steps to integrate GitHub with Jira. Also, why don't you just use BitBucket Cloud, it's free for unlimited private repositories + up to 5 users. Then you can use the whole Atlassian's products working together smoothly. –  Feb 16 '22 at 09:12
0

I will suggest to add Jira ID in PR title, then it will automatically links. ex: [RKK-<JIRA_ID>] TITLE OF THE PULL REQUEST

If that is not possible, you can try adding the Jira ID to the following:

  1. branch name
  2. commit message.
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Gokul KKR
  • 1
  • 2