I have a transition that needs validation before continuing. Because it's a bit more complex,
I'm using JMWE with a jira expression. Unfortunately, my logic is turned around, and for the life of me I can't seem to get it correct. (I'm a long-time dev, so this is hurting my ego :))
I have an issue type with a field called Support Rep (customfield_10119). There are three possible outcomes of clicking this specific transition:
My current validator code is not working for cases 1 and 2; case 1 allowed me to transition (when the support rep was not me) and case 2 showed the custom error and did not allow the transition (when the support rep was me.) Case 3 works correctly.
Can someone help me out? I've tried changing the order of my conditions; tried changing from OR to AND, etc. and nothing seems to work.
ETA: I tried changing my expression to this, and now the first two scenarios work but the third doesn't.
(issue.customfield_10119 != null && user.accountId == issue.customfield_10119.accountId) || issue.customfield_10119 == null
Hi,
I believe you want:
!issue.customfield_10119 || user.accountId == issue.customfield_10119.accountId
Of course, that assumes customfield_10119 is a single-user picker custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.
Register today!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.