You can bulk remove users from the group that grants access to the application — typically jira-software-users
, though this may vary if the admin has customized it.
This can be done using a simple ScriptRunner script. In the script, you define a list of users and then remove each one from the group programmatically.
If you have list of usernames:
import com.atlassian.crowd.embedded.api.Group
List usernames = ["user1", "user2", "user3"]
Group baseGroup = Groups.getByName("jira-software-users")
usernames.each { String username ->
baseGroup.remove(Users.getByName(username))
}
If you want to remove everyone from group:
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.crowd.embedded.api.Group
Group baseGroup = Groups.getByName("jira-software-users")
Collection allUsersInGroup = ComponentAccessor.getGroupManager().getUsersInGroup(baseGroup)
allUsersInGroup.each { ApplicationUser user ->
baseGroup.remove(user)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Evgenii
thank you so much it works fine
import com.atlassian.crowd.embedded.api.Group
List usernames = ["user1", "user2", "user3"]
Group baseGroup = Groups.getByName("jira-software-users")
usernames.each { String username ->
baseGroup.remove(Users.getByName(username))
}
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.