I'm attempting to write a Jira expression to use in Build-your-own (scripted) Validator in my workflow. I want an error message to appear during the transition, on the transition screen, when a specific Fix Version is present. I've come up with the following expression, which works correctly to return false if the Fix Version is not 16.x.x.
!!issue.fixVersions && issue.fixVersions.some(it => it.name != "16.x.x")
Result: false
Unfortunately Fix Version can have multiple values and if I have 16.1.1 and 16.x.x and I run the same expression, the result is true.
What do I need to do differently in my Jira expression to return false if 16.x.x is present at all, regardless of the other Fix Versions? Is it even possible in JMWE or is there another validator option that comes standard with Jira?
Hi @Karen Sterkowicz ,
If I understand you correctly, you want an error message to appear (the validator to fail) whenever any of the fix versions is exactly "16.x.x". In that case, I would use the filter() function, which can make the whole expression much smaller:
issue.fixVersions.filter(it => it.name == "16.x.x").length == 0
This expression will return true, unless 16.x.x is one of the Fix Versions. It does not matter whether you have no Fix Versions, one or multiple Fix Versions applied.
Cheers,
Oliver
@Oliver Siebenmarck _Polymetis Apps_ This is exactly what I needed. Thank you very much for the assist.
Karen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Karen Sterkowicz ,
you could try with this JQL:
fixVersion is not EMPTY AND fixVersion in ("16.0.0","16.0.1", ...)
with all Fix Versions you want in parentheses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.