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

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 Leaders.
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 Leaders.
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events