SVN commit should fail if the jira id is closed.

When ever users makes a commit to closed jira id, the commit should failed.

I installed commit acceptance plugin in jira and enabled "all issues referenced in the log message unresolved" but this is working on jira only i;e commit is success without throwing any error, but not reflecting on subversion tab in jira id.

What i am looking is commit should be failed saying jira id is in Closed status...

2 answers

1 accepted

I would suggest to forget JIRA commit acceptance and simple make a call to JIRA rest end point from the hook script (write in your favorite language).

Also an improvement which we did was to periodically dump the list of open issues from JIRA and commit to the protected path in the same repo and the actual hook script will look into only this file rather than making a JIRA call. This will also help to enhance the developer experience as everytime contacting JIRA will slow down the commit operations.

So all open issues need to be dumped in pre-commit hook script right?

Great i believe this will work, but only challenge is to script it :). Thanks for your support.

Decouple the script from the list of open issues. Dump the issues to a file inside svn and the hook script can read it from there.

The add-on named Commit Policy can check commits whether they contain issue keys and then match those against a JQL query.

In your use case the JQL should be trivially:

status != Closed

Give this a free trial!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,962 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you