Using regex in fixversion name

Pankaj Mehta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2024

I am trying to extract a character from the fixversion i create. The character is added to the end of the version name. Can i do 

{{version.name.match("[a-zA-Z]$")}} equals "A" then do ......

2 answers

0 votes
Bill Sheboy
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.
November 23, 2024

Hi @Pankaj Mehta -- Welcome to the Atlassian Community!

Although this could be done with a regular expression, have you tried using the right() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#right-int-length-

{{version.name.right(1)}}

 

If you still want to use the regular expression with match() please try this:

{{version.name.match(".*(.)")}}

 

Kind regards,
Bill

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 21, 2024

Hi @Pankaj Mehta 

As far as I know, you can use the match function to extract the last character of the version name and compare it. 

{{version.name.match("[a-zA-Z]$")}} equals "A"

Pankaj Mehta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 21, 2024

It seems it is not working as the log is not displaying the value of the match.

download.png

 

download (1).png

Suggest an answer

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

Atlassian Community Events