Hello there,
I’m trying to extract all Jira users with with below details
user name, full name, email id, status and last login time stamp
Using JIRA Data center and script runner, below is my script
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def userManager = ComponentAccessor.getUserManager()
def users = userManager.getAllApplicationUsers()
def userList = users.collect {
[
userId: it.key,
fullName: it.displayName,
emailAddress: it.emailAddress,
active: it.active,
lastLoginMillis: it.lastLoginMillis
]
}
// Print the user list (you can modify this to export to Excel)
userList.each { user ->
def lastLogin = user.lastLoginMillis ? new Date(user.lastLoginMillis) : null
println("User ID: ${user.userId}, Full Name: ${user.fullName}, Email: ${user.emailAddress}, Active: ${user.active}, Last Login: ${lastLogin}")
}
However I get this error
No such property: lastLoginMillis for class: com.atlassian.jira.user ApplicationUser
I really appreciate your suggestion on how can I fix this