Script Runner: get users not in jira-users group

I am trying to identify users not in the jira-users group. I have this script i found that gives me members of the jira users group but i'm not sure of the syntax to get only users not in the jira-users group. I also am trying to have this script send an email with the output of the script. I would appreciate being pointed to some resources that would help me with this. is there some documentation that shows this?

1. groovy script to show "non jira-users" members

import com.atlassian.jira.ComponentManager

def componentManager = ComponentManager.instance
componentManager.getUserUtil().getGroup("jira-users").getUsers()

Thank you.

1 answer

1 accepted

Accepted Answer
2 votes

You will have to get all users using getUsers method and use GroupManager to see if the user is in jira-users group or not.

http://docs.atlassian.com/jira/latest/com/atlassian/jira/security/groups/GroupManager.html#isUserInGroup%28java.lang.String,%20java.lang.String%29

to give credit where credit is due, I got this script from one of Jamie Echlin posts. Great script Jamie.

I will take a look at this option.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

22,034 views 2 7
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