Forums

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

How can I write a jira expression that fails transition if Fix Version doesn't contain hyphen (-)?

Stewart, Emily @ Global D&T March 12, 2025

I want to build a validator that won't let the user transition a ticket if one of the fix version values doesn't have a hyphen in it.

Background: We use fix version both for code releases which have a hyphen in them and for PI increments. The ticket will have a PI fix version on it, and I need the transition to fail if it also doesn't have a code release (with a hyphen) fix version on it.

Alternatively, if hyphen won't work, the validator could look for either: No-Deployment-Needed or a fix version containing 2025.

I've tried the Build-Your-Own Validator jira expression, but I don't have the coding skills to get it right.

Thanks in advance! 

1 answer

1 accepted

1 vote
Answer accepted
Maciej Dudziak _Forgappify_
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 13, 2025

Hi Stewart, Emily @ Global D&T,

Welcome to the Community! If I understand correctly, transition should work if at least one of the versions contains "-", in that case following should work:

issue.fixVersions != null
&& issue.fixVersions.some(item => item.name.indexOf("-") != -1)

 If you are new to Jira expressions, have a look on the Ultimate Validator that my team developed. It can generate the expression for you using simple UI

community_13.03.2025.png

I hope this helps.

Cheers!

Stewart, Emily @ Global D&T March 14, 2025

This totally worked! Thanks so much, @Maciej Dudziak _Forgappify_ ! I will check out your app. I spent many hours trying to figure this out, so your app must be amazing. 

Maciej Dudziak _Forgappify_
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 14, 2025

You're welcome

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