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")
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.
👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event