Jira > Groovy Script Runner > Scripted field > Add only certain User Groups to the custom field

Good day good people,

I've created a custom scripted field that gets the Reporter's Groups value. My problem is though, that some reporters are in more than one group, like fx. "jira-users" and "jira-qa" and now it returns a list of groups, but I only want certain groups to be shown.

Is there a way I can only add certain groups to the field, fx. if the reporter is in mentioned groups above, that it only adds the "jira-qa" group to the custom field. Basically I want "jira-administrators", "jira-developers" and "jira-users" NOT to be shown, if that's easier.

1 answer

1 accepted

1 votes
Henning Tietgens Community Champion Apr 16, 2013

You can define a list of groups that should be ignored and subtract this list from the list of groups of the reporter.

ignoredGroups = ['jira-users', 'jira-developers']

resultGroups = reporterGroups - ignoredGroups

This only works if you are working with the group names.


You guys make it look soooo simple! ;) Worked like charm, many thanks Henning.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,975 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot