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,623
Community Members
 
Community Events
184
Community Groups

Verify Assignee's Group in JMWE Validator

Hi There, 

 

I know there's a way to verify the user's group in JMWE via the following expression:

user.groups.includes("group name")

However, I met the scenario that needs to verify the assignee's group. Any advice on the expression?

 

Thanks,

Olive

 

1 answer

1 accepted

2 votes
Answer accepted
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 26, 2021

Hi @Olive Sun ,

you can do this:

issue.assignee && issue.assignee.groups.includes("group name")

It's important to first test whether issue.assignee is null, otherwise you'll get an error accessing its groups when it is.

Thanks, @David Fischer _Appfire_ !That works perfectly.

Like John Funk likes this

Hi @David Fischer _Appfire_, would you mind also share the way to verify whether the assignee is in the specific project role or not?

Not sure if the following expression is correct.

 

issue.assignee && issue.assignee.getProjectRoles(issue.project).some(pr => pr.name == "Developers")

 

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 27, 2021

@Olive Sun it is (assuming you're looking for the Developers project role)

Like Olive Sun likes this

Hi @David Fischer _Appfire_ , I tried that expression, it only works when I set with "==":

issue.assignee && issue.assignee.getProjectRoles(issue.project).some(pr => pr.name == "Developers")

If I set with "!=" as follows, it doesn't work and keeps return "True".

issue.assignee && issue.assignee.getProjectRoles(issue.project).some(pr => pr.name != "Developers")

 Any thoughts?

 

Thanks,

Olive

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.
Jul 05, 2021

Hi @Olive Sun 

why would you use != ? You mean for a different requirement? What would be the requirement then?

David

Hi @David Fischer _Appfire_ , for one transition, I want to make the condition as the user is in project Role A, and for the other transition, I want to make the condition opposite wat. This means the user is not in project Role A. 

 

That's why I want to use !=, any thoughts?

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.
Aug 03, 2021

Hi @Olive Sun ,

that would be:

issue.assignee && !issue.assignee.getProjectRoles(issue.project).some(pr => pr.name == "Developers")

Thank yoooooou!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events