...
This groovy script will find all projects where a specific Jira group is used by a project, through its permission scheme. A group is being deemed as being used by a project, where it's used by its permission scheme, either directly or through a project role.
Expand |
---|
|
This groovy script will find all projects where a specific Jira group is used by a project, through its permission scheme. A group is being deemed as being used by a project, where it's used by its permission scheme, either directly or through a project role. Code Block |
---|
import com.atlassian.confluence.user.DisabledUserManager
import com.atlassian.crowd.embedded.api.CrowdService
import com.atlassian.sal.api.component.ComponentLocator
import com.onresolve.scriptrunner.parameters.annotation.ShortTextInput
@ShortTextInput(label = "Users", description = "Type usernames of deactivated users you would like to reactivate, seperated by spaces")
String names
assert names
def disabledUsers = names.split()
def disabledUserManager = ComponentLocator.getComponent(DisabledUserManager)
def crowdService = ComponentLocator.getComponent(CrowdService)
disabledUsers.each { userName ->
def user = crowdService.getUser(userName)
if (user) {
if (disabledUserManager.isDisabled(user)) {
disabledUserManager.enableUser(user)
log.info("User $user.name has been enabled")
} else {
log.info("User $user.name is not disabled")
}
} else {
log.debug("User $userName was not found.")
}
} |
|