How can I find all JIRA users without any group assignments?

Can anybody think of a way to find all JIRA users that do not belong to any group?

MySQL query would be fine - I just need userIDs. Somebody who worked here before thought that removing all group permissions was sufficient to keep a user "active", but we're finding that unless a user has Assignable and Create Issue (?) permissions, Bulk Changes are getting hung up on these "zombie" users.

My plan, once I get the list, is to use the JIRA CLI to assign these users to an "Ex-employees" group that only has the above permissions.

Thanks!

2 answers

1 accepted

4 votes
Henning Tietgens Community Champion Aug 20, 2013

You can use the Script Runner plugin and the following script:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserUtil

UserUtil userUtil = ComponentAccessor.getUserUtil()

result = ''

userUtil.getUsers().findAll{userUtil.getGroupsForUser(it.getName()).size() == 0}.each{ u ->
    result += u.name + "\r\n"
}

result

Henning

Thanks Henning, this worked like a charm!

I believe this is close to what you are looking for.

SELECT U.ID, U.user_name, G.group_name
FROM cwd_user U
LEFT JOIN cwd_membership M ON U.ID = M.child_id
LEFT JOIN cwd_group G ON G.ID = M.parent_id
WHERE M.child_id IS NULL

Thanks for the answer Norman, but it was easier for me to just run it from Script Runner.

Thanks man, exactly what i was looking for.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

59 views 0 5
Read article

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