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!
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 + "<br>" } result
Henning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use the suggested Scriptrunner script and get this error:
startup failed: Script20.groovy: 8: expecting '}', found '-' @ line 8, column 90. tName()).size() == 0}.each{ u -> ^ 1 error
I'm not sure why I'm getting an error about the curly bracket "}" at that point. I copied and pasted this script directly into the Scriptrunner script console and ran it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, it's a HTML conversion error from Atlassian Answers to Atlassian Community. I corrected the script, please try to copy it again.
Henning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy Days are Here Again. Thanks a lot!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer Norman, but it was easier for me to just run it from Script Runner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks man, exactly what i was looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.