You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.