Using custom JIRA issue keys with Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Ask the community

Bitbucket Server assumes that JIRA Software issue keys are of the default format (that is, two or more uppercase letters ([A-Z][A-Z]+), followed by a hyphen and the issue number, for example TEST-123). By default, Bitbucket Server will not recognize custom issue key formats.

You can use custom issue key formats with Bitbucket Server, however note that integrations with JIRA Software can depend on using the default issue key format in both applications. See Integrating using custom JIRA Software issue keys for more details.

Configure Bitbucket Server to recognize custom issue key formats by editing <Bitbucket Server installation directory>/bin/setenv.sh (on Windows, edit <Bitbucket Server installation directory>/bin/setenv.bat instead).

To override the default issue key format, use the JVM_SUPPORT_RECOMMENDED_ARGS property, like this:

Bitbucket Server and Stash 2.8 or later:
JVM_SUPPORT_RECOMMENDED_ARGS="-Dintegration.jira.key.pattern=\"(<Some different regex>)\""

You'll need to restart Bitbucket Server.

 

For example, to use lowercase letters in issue keys, use a regex with the parameter like this:

Bitbucket Server and Stash 2.8 or later:
"-Dintegration.jira.key.pattern=\"((?<!([a-z]{1,10})-?)[a-z]+-\d+)\""

See also Reindex JIRA Software issue keys.

As always, please back up your home directory (and perhaps the database) before performing any manual operation on Bitbucket Server. Consider testing this change on another copy of Bitbucket Server before using it in production.

Last modified on May 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.