Forums

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

How would I get just the number of {{issue.key}}?

Angel Ferreira
Contributor
March 11, 2022

Hi

 

Is it possible get just the number from key with smart values? 

 

Thanks

3 answers

1 accepted

2 votes
Answer accepted
Fabian Lim
Community Champion
March 11, 2022

Hi @Angel Ferreira

You can try using the text functions to get the characters after the "-". Link: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

I suggest you copy the key to a new variable and then try finding the location of "-" and then using a substring from the location +1 to the end.

Good luck

Angel Ferreira
Contributor
March 14, 2022

Thats works I used: 

{{issue.key.substringAfterLast("-")}}

 

Thanks

Like # people like this
1 vote
Jack Brickey
Community Champion
March 11, 2022

Interesting question. You can’t do that though. 

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.
March 11, 2022

I'm intrigued about why!  What use is only part of the key of an issue?  I can't think of a use for it (well, a few migration contexts, but only to compare with existing data, which isn't something I'd use Automation for)

0 votes
Tuncay Senturk
Community Champion
March 13, 2022

Hello @Angel Ferreira 

Have you tried issue.number?

As far as I know, issue.getNumber() method returns the issue number as a long value.

Suggest an answer

Log in or Sign up to answer