The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Using regex in fixversion name

Pankaj Mehta
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

Comments for this post are closed

Community moderators have prevented the ability to post new 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 Champions.
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 _Snapbytes_
Community Champion
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
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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events