The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

List of users who are ONLY in the default jira users group.

kaizad.irani
Contributor
January 8, 2020

I need to extract a list of users who are ONLY in the default jira-users and no other groups.

 

By default, all users get added to the default jira-users group; and then we add them to further groups. I want a list where a user is just in this default group and not yet added to any other group.

 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
kaizad.irani
Contributor
January 9, 2020

Hi Shankar, Our instance is Not on prem. We have a cloud instance and do not have database access to run SQL. Hence unable to do this.

Any other suggestion?

Shankar Asam {Appfire}
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 Champions.
January 12, 2020

Hi Kaizad,

You can leverage the power of JIRA CLI commands to get the list of users in a group and also multiple groups for a single user as well. The CLI can do lot more other things as well. See the examples here.

To get the list of all users, 

jira.sh --action getUserList --name "@all"

you can get all user names from the database and route them a file. 

To get the lists of user groups (membership) , I am sure they belong to at least 1 group (which is jira users default group)

jira.sh --action getUser --userId "$username" | grep "Group"

You can only return values(users) whose count is not more than 1 (it should be default group)

jira.sh --action getUser --userId "$username" | grep "Group" | wc -l

 

Hope this helps

 

-Thanks

0 votes
Shankar Asam {Appfire}
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 Champions.
January 9, 2020

Hi,

Can you try this SQL command to see if it gives what you wanted?

 

select * from cwd_user where user_name not in (select child_name from cwd_membership where parent_name  not in ('jira-software-users'));

-Shankar

TAGS
AUG Leaders

Atlassian Community Events