JIRA key is case sensitive for the commit message in Stash

Deleted user March 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
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 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
ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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 February 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 7, 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 March 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
TAGS
AUG Leaders

Atlassian Community Events