Script Runner: get users not in jira-users group

Jeff Underwood August 27, 2012

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

2 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 27, 2012

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

Jeff Underwood August 27, 2012

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

Jeff Underwood August 27, 2012

I will take a look at this option.

Suggest an answer

Log in or Sign up to answer