Can I add multiple keys under link to issue keys ?
Asked by Jalpesh Rajani:

I would like to add multiple keys from multiple jira projects under link keys settings. However am not sure if multiple keys are accepted.


Answers:
author: Patrik S
body: Hello [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) ,

Thank you for reaching out to Atlassian Support.

You can definitely link the repository to more than one Jira project, but the Link Key settings under repository settings are automatically done for you once you connect your bitbucket cloud instance with your Jira cloud instance.

In case you want to link additional projects to a repository in Bitbucket, from multiple jira projects, you can follow the below steps :
> 1. In your repository navigation panel, click **Jira issues.** In the issue list, select the folder icon located at the top right-hand side and click **Manage linked projects.**
>
> 2. In the dialog, select a project from the dropdown, then click **Link project.**

Then, once you include the jira issue key in the commit messages for that repository, these commit will be linked to the respective Jira project.

More details on how to link/unline Jira projects are outlined in the below documentation :

* <https://support.atlassian.com/bitbucket-cloud/docs/use-jira-software-projects-in-bitbucket/#Link-project-to-a-repository-automatically>

Hope that helps! Let me know in case you have any questions.

Thank you, [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) .

Kind regards,

Patrik S

comments: author: Jalpesh Rajani
body: Thanks [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) however my question is on a different page. We have a links option in bitbucket settings where I can add jira project keys. If the key is not present with a ticket number in the commit message, the push is blocked. If I need to add for multiple jira projects, I need to add each individually. Can I do it in one insert?


author: Patrik S
body: Hey [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) ,

Are you referring to *Repository Settings \>\> Links* page? If possible, could you share a screenshot of the page you are referring to?


author: Jalpesh Rajani
body: Yes this section.

![Screenshot 2022-06-29 at 9.57.30 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/203786i4FCC34D945BB881B/image-size/large?v=v2&px=999 "Screenshot 2022-06-29 at 9.57.30 AM.png")![Screenshot 2022-06-29 at 9.57.48 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/203787i0D4A9F82F4C3B0B2/image-size/large?v=v2&px=999 "Screenshot 2022-06-29 at 9.57.48 AM.png")


author: Patrik S
body: Hello [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) ,

When you push your changes to bitbucket cloud and add a jira issue key in the commit message, Bitbucket will automatically link the repository being pushed with the corresponding Jira Project, considering you [have already connected Bitbucket with your Jira instance.](https://confluence.atlassian.com/bitbucket/connect-bitbucket-cloud-to-jira-software-cloud-814190686.html)

However, in case you want to manually connect the repository to a given Jira project, you need to use a different menu, as I shared previously :
>
> * In your repository navigation panel, click **Jira issues.** In the issue list, select the folder icon located at the top right-hand side and click **Manage linked projects.**
>
> * In the dialog, select a project from the dropdown, then click **Link project.**
>
The dropdown will show all the Jira projects you currently have permission to link, and you will be able to select and add them individually.

Kind regards,

Patrik S


author: Jalpesh Rajani
body: Yep I understand.

what I am looking for is blocking commits from being pushed to repo if it does not have the jira key, which is what the links helps with.


author: Patrik S
body: Hello [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) ,

When you integrate your Bitbucket workspace with a Jira Cloud instance, a read-only link like the below should be created automatically in your workspace :

![Screen Shot 2022-07-04 at 11.48.08.png](https://community.atlassian.com/t5/image/serverpage/image-id/204457i2741BB4C0309F3BE/image-size/large?v=v2&px=999 "Screen Shot 2022-07-04 at 11.48.08.png")

This is a generic regex that will match any issue key in that Jira instance when you reference the issue key in the commit message.

So when toggle the option "Require issue keys in commit messages", you will be able to commit using different issue keys without needing to add an individual link to each of them. You will only be blocked from committing if you use a issue key that is not present in any of the connected Jira instances.

In this case, you can confirm if your repository has that generic link created, and if not, you can try to [remove](https://support.atlassian.com/bitbucket-cloud/docs/connect-bitbucket-cloud-to-jira-software-cloud/#Manage-your-linked-workspace-settings) and [recreate the Jira integration](https://support.atlassian.com/bitbucket-cloud/docs/connect-bitbucket-cloud-to-jira-software-cloud/#Connect-your-Bitbucket-workspace-to-Jira-Software-Cloud) with your Bitbucket workspace, so the link will be automatically created for you.

Let me know if you have any questions.

Thank you, [@Jalpesh Rajani](/t5/user/viewprofilepage/user-id/3932900) .

Patrik S


Tags: bitbucket-cloud

cloud