Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Smart value for Issue Key without the Project code

Kate
Contributor
September 7, 2023

I am setting up a new space; the team utilising it have a requirement for a specific reference key to be generated with every ticket to help with their recordkeeping. 

The key starts with [Financial year] [code for task type] and they would like it to finish it with only the number from the Jira key eg: if the ticket was XX-151, the reference would be 2024QUS151

Is there a smart value that displays ONLY the number from the key?

1 answer

0 votes
Nic Brough -Adaptavist-
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.
September 9, 2023

No, because the number alone is not a unique identifier of an issue, so it's pretty much useless.

You have an unusual use for it, one that I do not think you have thought through fully.  Your reference could easily end up as non-unique, as you could generate the same one from two different projects with unrelated issues.

But, although I have not tried this, I think you can extract the number by splitting the key, something like:

{{issue.key.split("\-").second}}

(This does rely on the key coming out as a string, and you may need to mess with the simple "\-" I've used as the separator - I'm very rusty on regular expressions) 

Kate
Contributor
September 12, 2023

Hi Nic,

Thanks for your response; This is an attempt to get Jira to generate a number that can reference a large amount of information about the ticket at a single glance, while continuing to link them back to the original Jira ticket.

It's being generated for ONLY one team - would definitely push back if this was to be used outside of one Project space.

Will steal the suggested smart value and see if I can get it to work :) Thanks

Like Nic Brough -Adaptavist- likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events