I'm creating a Validator that checks to see if a multi-user selection field (issue.customfield_11887) doesn't contain the Issue reporter.
I've tried the following, but it doesn't seem to work.
!!issue.customfield_11887 || issue.reporter
Any clues would be appreciated.
Thanks
Jamie
try this instead:
!issue.customfield_11887 || !issue.customfield_11887.some(u => u.accountId == issue.reporter.accountId)
Hi Jamie:
You cannot use the "||" operator, because it means a OR testing. Your code is customfield_11887 is not empty or "reporter". The reporter test is not doing anything.
You may need to obtain the reporter information (i.e. issue.reporter.accountId) first, then compare it with content of your other custom field.
Take a look on using Jira Expression when creating your Scripted (Groovy) Validator via JMWE -
https://developer.atlassian.com/cloud/jira/software/jira-expressions-type-reference/#user
At this time, I have not constructed the script to test it out due to my other work related tasks.
Hope this helps.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
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.