I followed this https://confluence.atlassian.com/adminjiraserver/create-edit-or-remove-a-user-938847025.html
however I don't see an "active" checkbox in the user profile page.
If you have script runner add-on installed, use the below script to deactivate the users,
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.crowd.embedded.api.CrowdService
import com.atlassian.crowd.embedded.api.UserWithAttributes
import org.apache.log4j.Level
log.setLevel(Level.INFO)
def numOfDays = 90 as int
def dateLimit = ( new Date() ) - numOfDays
def groupManager = ComponentAccessor.groupManager
def crowdService = ComponentAccessor.crowdService
def userManager = ComponentAccessor.userManager
def userUtil = ComponentAccessor.userUtil
def const_groupname = 'jira-users'
def group = groupManager.getGroup(const_groupname)
def groupMembers = groupManager.getDirectUsersInGroup(group)
def counter = 0 as int
groupMembers.each{ applicationUser ->
if( applicationUser.isActive() ){
def user = crowdService.getUserWithAttributes( applicationUser.name ) as UserWithAttributes
def lastLoginMillis = user.getValue('login.lastLoginMillis') as String
if( lastLoginMillis?.isNumber() ){
def date = new Date(Long.parseLong(lastLoginMillis)) as Date
if( date.before(dateLimit) ){
counter++
userUtil.removeUserFromGroup(group, applicationUser)
}
}
}
}
log.info "Removed ${counter} users"
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.