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

JIRA key is case sensitive for the commit message in Stash

Jonny Xu Mar 21, 2013

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

0 votes
Answer accepted
Charles O'Farrell Mar 21, 2013

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

2 votes
Thiago Bomfim Atlassian Team Jan 13, 2014

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

Shubham Aggarwal Feb 18, 2018

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?

1 vote
denkmalneu GmbH May 07, 2013

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.

0 votes
Darko Cerdic Mar 30, 2014

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 Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,181 views 6 15
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