Adding a condition to a structure board formula

pavan_cheruvu March 4, 2024

Hi

I am using the below formula to retrieve the sorted list of fixVersions.

fixVersions .map(v -> ARRAY(v, v.name.replace(".", ""))) .sortBy(v -> -v.GET(1)) .first().GET(0)

THe format of the fixVersion is YY.MM.DD  It can have multiple values, as we append the latest fixVersion.

We also have a scenario, where the fixVersion may be a free text / string of text like "To be updated in Q2" or something else, if the fixVersion is not available when the issue is created.

Hence, I would like to add condition , such that the free text is retrieved, if no values in the format YY.MM.DD exist.

I have tried multiple version of the if statement, using Regex , but unable to get the syntax correctly. We are on JIRA 8.0.01

( .findAll { v -> !v.name.matches(/^\d{2}\.\d{2}\.\d{2}$/)} and variations of the same do not work.)

Request a suggestion on the syntax to be used.

Regards, Pavan 

 

1 answer

0 votes
seed
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!
March 4, 2024

The user is seeking assistance with a Groovy script used in JIRA to retrieve sorted fixVersions. They want to modify the script to handle scenarios where fixVersions are in different formats, including free text. They are specifically looking for guidance on using conditions and regex in the script.

Suggest an answer

Log in or Sign up to answer