JIRA key is case sensitive for the commit message in Stash

We are using the Stash/JIRA integration feature in our system.

Follow the intruction from page: http://quickstart.atlassian.com/download/stash/jira-integration

but when the jira key in the commit message is lower case. the stash will not be able to detect the jira key in the commit message.

e.g. commit message "abc-123, change somthing"

in stash, after this commit, the jira issue 'ABC-123' will not be added as a link.

how can we turn it to case-insensitive?

4 answers

1 accepted

Hi Jonny,

Internally we use a regex to index the JIRA issues. You can override the default by setting the following as a property when starting Stash. This is the same as our regex with [a-z] instead of [A-Z].

-Dstash.jira.key.pattern="((?<!([a-z]{1,10})-?)[a-z]+-\d+)"

This will start to index issues from this point onwards. If you want to re-index commits already in Stash you will have to delete the cached index:

$STASH_HOME/caches/idx-snapshots

$STASH_HOME/data/snapshots (in Stash 2.11+)

As always, please backup your home directory (and maybe even the database) before performing any manual operation on Stash. My suggestion might be to test this on another copy of Stash before running in production.

Cheers,

Charles

Hi,

In order to keep track of this issue, please refer to the up-to-date Integrating with custom JIRA issue key Knowledge Base article.

Notice that at as of the 2.8 release, the name of the system parameter is changed.

You will need to configure your <Stash_Install>/bin/setenv.sh file like this:

JVM_SUPPORT_RECOMMENDED_ARGS="-Dintegration.jira.key.pattern=\"((?&lt;!([A-Za-z]{1,10})-?)[A-Za-z]+-\d+)\""

Best regards,

Thiago Bomfim

Atlassian Support - Stash

Doesn't work for us. The variable is defined as follows for us:

JVM_SUPPORT_RECOMMENDED_ARGS="-XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -3 %p' -XX:HeapDumpPath=/opt/bitbucket/4.11.2/heap/dump -Dintegration.jira.key.pattern=\"((?&lt;!([A-Za-z]{1,10})-?)[A-Za-z]+-\d+)\""

 

I also couldn't find a call to the variable in start-webapp.sh. Do you know where it is called?

Just edit this line in setenv.sh so it looks like the following:

JVM_SUPPORT_RECOMMENDED_ARGS="-Dstash.jira.key.pattern='((?&lt;!([A-Za-z]{1,10})-?)[A-Za-z]+-\d+)'"

This will work on both, upper and lowercase formats.

Hi,

is it possible to support Jira integration if Jira keys are uppercase (like IN-2242) and Stash branches are lowercase (like in-2242-some-description)? Currently Jira does not detect branches created in Stash for Jira issues.

We would like to avoid mixing uppercase and lowercase when creating branch names but our projects are already set up with uppercase ID's and we would like to keep it that way.

We use Jira OnDemand.

Thanks,

Darko Cerdic

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,307 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