I have a scenario where we have a JIRA instance (6.4.7). I have to do some user management clean up and I'm wanting to be able to run a script (ideally using Scriptrunner) to allow me to remove multiple users from a specified group..
Any help would be appreciated
You should be able to do something like this:
def groupManager = ComponentAccessor.groupManager
def userUtil = ComponentAccessor.userUtil
def userManager = ComponentAccessor.userManager
def usersToRemove = ["exampleUser1","exampleUser2","exampleUser3","exampleUser4","exampleUser5"] //User Names
def groupToAlter = groupManager.getGroup("NameOfGroup")
def currentUser = userManager.getUserByName(it)
Take this script, fill in the user names, fill in the name of the group, and then run it in the Script Console!
Is this close to what you were looking for? :D
Hi @Aidan Derossett _Adaptavist_ tried your script in Jira 6.4.13 in script console, getting error :
No signature of method: com.atlassian.jira.user.util.UserUtilImpl.removeUserFromGroup() is applicable for argument types: (com.atlassian.crowd.embedded.impl.ImmutableGroup, com.atlassian.jira.user.DelegatingApplicationUser)
Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events