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: 
  • Community
  • Q&A
  • Jira
  • Questions
  • How can I write a jira expression that fails transition if Fix Version doesn't contain hyphen (-)?

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

Stewart_ Emily _ Global D_T
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Maciej Dudziak _Forgappify_
Atlassian Partner
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
Contributor
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. 

Like • Maciej Dudziak _Forgappify_ likes this
Maciej Dudziak _Forgappify_
Atlassian Partner
March 14, 2025

You're welcome

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events