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 Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

906 views 3 9
Read article

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