I'm trying to find a way to delete users from JIRA software from the user directory: JIRA Internal Directory as they are already existing in the LDAP directories. There are about 1000 users to remove.
I am wondering if you can provide some guidance on using script console to delete the users.
The code I have is the following but does not capture the user directory piece.
import com.atlassian.jira.component.ComponentAccessor
def userUtil = ComponentAccessor.userUtil
def userManager = ComponentAccessor.userManager
def usersToRemove = ["exampleUser1","exampleUser2","exampleUser3","exampleUser4","exampleUser5"] //User Names
usersToRemove.each{
def currentUser = userManager.getUserByName(it)
}
The rest api: http://<JIRA URL>/jira/rest/api/2/user/
However I am getting a page cannot display error when launched.
Not familiar with scripting/coding.