SVN Commit lock for JIRA

We need to have a way to mandate commit information in SVN external for JIRA tickets. For eg: When developer commits a file we need to make sure we mandate some information on the commit comments like JIRA ticket number, description etc.

1 answer

Have you tried to use SVN hook? Try to parse commit message against:


If its not in the commit message then reject commit.

This is a bit out of topic but someone may find it useful, therefore I share that with you. If you're working on a branch that is named after Jira issue for example DEMO-10, the script would add some smartcommit info to your commit message which adds comment in your issue and opens code review in Crucible.

# Mateusz Harasymczuk
# This hook message should go to .git/hooks/commit-msg
# Remember to add (*nix machines) executable rights: chmod +x .git/hooks/commit-msg
# Hook checks branch you're currenly on and adds its name to commit message.
# It adds commit message as a comment in jira connected with this issue.
# Moreover it creates a Code Review in Crucible.
# You'll never forget about this things anymore :}
# The only thing you should do is to create an issue for each branch you have.
# For example if you are working on issue DEMO-123 create a branch called DEMO-123
# Each commit on this branch would have DEMO-123 in the commit message and Code Review process attached to it.

issuekey=$(git symbolic-ref HEAD |egrep --only-matching '[A-Z]{2,10}-[0-9]{1,6}')
commitmsg=$(cat "$1")

if [ -z "$issuekey" ]; then
   echo "You're not working on issue branch!"
   echo "Please create a branch named after issue."
   echo "Commit message will be updated accordingly in order to contain branch/issuekey in the commit message."
   exit 1
   echo "$issuekey #comment $commitmsg +review" > $commitmsgFile

Hi Matt,

Thanks for your answer. I came across this link in my research:

Can you please take a look at this Atlassian plugin that allows us to restrict SVN to require a JIRA ticket to commit? Please see if there will be an issue of us putting this into our SVN.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,264 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot