Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,000
Community Members
 
Community Events
165
Community Groups

How do you configure BitBucket cloud to require pull requests to link to an open JIRA issue

I am exploring Atlassian tools for my company, as a possible option to our own current SCM/issue management tool set. One of the features our current integration contains, which we don't want to sacrifice, is the ability for the SCM tool to require that the commit is connected with at least one open issue ID in the issue management tool.

I know that BitBucket cloud integrates with JIRA cloud, such that a JIRA issue will quickly identify branches and pull requests connected with a given JIRA issue by searching for the ones whose names start with that issue ID.

But how do you take this one step further and prevent the ability to merge a pull request whose name does not start with a valid JIRA issue ID, or (better), whose associated JIRA issue is not in a particular state?

Any help/insight is appreciated.

(Yes, I know you can restrict /who/ can merge pull requests, so that you could just train them all to not merge PR's without open JIRA issues. That's not what we want; there's got to be a way to make it work the way I describe.)

1 answer

0 votes
Caroline R Atlassian Team Sep 13, 2021

Hi, @Dan Engel! Welcome to the community! 

Currently, we do have an option to enforce the use of Jira Issue Keys on commit messages. In order to enable this feature, you can follow the next steps:

  • Open the repository you would like to change 

  • Go to Repository Settings > Links

  • Enable the "Require issue keys in commit messages" option 

Once enabled, Bitbucket will only accept pushes to your repo if the pushed commit message contains an issue key. 

For now, it is not possible to enforce the usage of Issue Keys strictly on Pull Requests, this is only used in commit messages. However, we already have a Feature Request to make it possible to enforce this behavior on Pull Requests: 

I would suggest that you add your vote there (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

I hope this helps, but do let me know if you have any questions. 

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,248 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you