It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Git commit with Valid Jira issue code

Latha Sama May 19, 2014

I am able to write an update which allows the the format of the PROJECT-###: <message> in commit and if it misses it throws oout the ERROR. Now I am looking to make sure the PROJECT-### is valid Jira issue number (as It takes any number which is not a valid number)

Need Help

2 answers

0 votes
Timothy Chin Community Leader May 19, 2014

You need to write a Git pre-commit hook for your repositories. Or if you are using Stash, write one for it.

Latha Sama May 20, 2014

I need the shell to validate the Jira ticket number. I have already written the hook with does take the format of the ticket but does not validate with Jira if the ticket exists or not.

Timothy Chin Community Leader May 21, 2014

Extend your script to make the call to JIRA then. If the response code is anything other and a 2xx or a 3xx, you know you've got a invalid issue key.

0 votes
Ferenc Kiss [Midori] Aug 11, 2015

Commit Policy Plugin verifies not only the syntactical correctness of JIRA issue keys, but also check them against a JQL query!

See:

Edit Commit Policy.png

This is the relevant part of the documentation: http://www.midori-global.com/products/jira-commit-policy-plugin/documentation/#issue-in-jql-result-condition

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Software

Early Access: If you use Jenkins and Jira Software Cloud, you need to read this!

The Jira Software Cloud Team has been busy working on a simple, secure, and reliable way to integrate your build and deployment information from Jenkins with Jira Software Cloud. This means you don’t...

214 views 0 7
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