Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

make jira issue mandatory during commit or pull request

Ashish Saini
Contributor
October 11, 2021

Hello Community, 

Need help please 

For better tracebiliy ,we want to make sure developers mentioned jira issue number dueing commit or pull request 

How can we achieve it in bitbucket cloud 

I am new to bitbucket , so please excuse if this is a simple question

 

Thanks

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 12, 2021

Hi @Ashish Saini,

There is a setting on the repository level to require an issue key in commit messages.

Can you please confirm if you are using Jira Cloud? If so, the first step is to double-check if the Bitbucket workspace that owns the repos you are working on, is already integrated with your Jira Cloud instance (and if not, integrate them).

  1.  Log in to https://bitbucket.org/
  2. Select your avatar > All workspaces
  3. Select the workspace that owns the repos your team is working on
  4. Select the option Settings from the sidebar (you'll need to be an admin of the workspace to see this option)
  5. Then select Jira from the new sidebar

If you see the Jira Cloud instance you use listed there, with the option Disconnect, it means the integration is already in place. Otherwise, you will see a link Connect. You can use that to make the integration (you'll also need to be an admin in Jira to perform this).

After you confirm that the integration is there:

  1. Open a repository of this workspace in your browser
  2. Select from the sidebar > Repository settings > Links
  3. You should be able to see some Read-only links for Jira. You will also see an option Require issue keys in commit messages. If you enable that, users will not be able to push any commits that don't have an issue key in their commit message.

We don't have a setting to require an issue key in PR titles and/or description. There is a feature request about this in our issue tracker that you can vote for if you'd be interested in that:

I'd like to mention here that if a PR is created without referencing an issue key, but the commits of the source branch have issue keys in their messages, then this PR will still be displayed in the respective issues in Jira.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Ashish Saini
Contributor
October 12, 2021

Thanks @Theodora Boudale  for such a nice and details description 

I will try the steps mentioned and update you :)

 

Thanks

Ashish

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 13, 2021

You are welcome Ashish, I'll wait to hear your update then!

Ashish Saini
Contributor
October 19, 2021

@Theodora Boudale : Hi Theodora .  i tried the solution and it worked 

However , it is also allowing invalid jira issues as well in the commit 

For example : I have AC-5 as a valid jira issue and it allows commit 

When i try with AC-55 , this issue is not available in jira itself ..still it allows the commit 

How can we avoid invalid issues during commit

Can you please advice

 

Thanks
Ashish

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2021

Hi Ashish,

Thank you for your reply.

The links in commit messages are created based on regular expressions. At the moment, I'm afraid that we don't do an issue validity check before creating a link.

We have a feature request about this in our issue tracker:

If you're interested in this, I would suggest that you add your vote in the feature request (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.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Ashish Saini
Contributor
October 19, 2021

Thank you @Theodora Boudale  for the support and update 

It was really helpful 

Glad to be part of Atlassian Community 

 

Thanks
Ashish

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2021

You are very welcome Ashish, I'm more than glad to have helped.

Please don't hesitate to reach out if you ever need anything else!

Kind regards,
Theodora

0 votes
Tamir Melamed February 28, 2024

Is it also possible with GitHub?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2024

Hi Tamir,

I'm not aware of that. The repository links and the option "Require issue keys in commit messages" are a Bitbucket feature and the links are not limited to Jira. You can reach out to GitHub support team to ask if such a feature is available in GitHub.

Kind regards,
Theodora

Like Sabine Mayer likes this
TAGS
AUG Leaders

Atlassian Community Events