Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a validator using IsInGroup

giuseppe IN March 24, 2022

Hi,

I'm working on a transition of a workflow and I've added the following validator:

issue.get("Custom field Users")?.any{it.isInGroup("My Group")}

It works fine if I want to check whether at least one user contained in the field "Custom field Users" belongs to the group "My Group".

My goal is to check whether at least one user contained in the field "Custom field Users" doesn't belong to the group "My Group". How should I write the validator? Probably is just a NOT to be added but I didn't manage to solve the problem.

Thanks,

Giuseppe

1 answer

1 accepted

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 24, 2022

Hi @giuseppe IN , welcome on the community :)

Did you try?

issue.get("Custom field Users")?.any{ !it.isInGroup("My Group") }
giuseppe IN March 25, 2022

Hi @Martin Bayer _MoroSystems_ s_r_o__ . Thanks, it works!

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 25, 2022

you are welcome :)

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events