Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,636
Community Members
 
Community Events
184
Community Groups

Need a Multiple User selection expression for JMWE validator

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

2 answers

1 vote
David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2023

Hi @jamie_gordon 

try this instead:

!issue.customfield_11887 || !issue.customfield_11887.some(u => u.accountId == issue.reporter.accountId)
1 vote
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 15, 2023 • edited

@jamie_gordon -

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events