Good Morning,
How can i determine the creation date of an user with Scriptrunner?
The Last Login date can i determine with
import com.atlassian.jira.component.ComponentAccessor
CrowdService crowdService = ComponentAccessor.crowdService
UserWithAttributes user = crowdService.getUserWithAttributes(it.getName())
String lastLoginMillis = user.getValue('login.lastLoginMillis')
Is there also exists a function like login.lastLoginMillis with the cration Time? I Cant find it in the documentations but perhaps I'm to Stupid!
Ps: it is not possible for me to use SQL on the user table
From the code, you can see that the "user" object is an instance of a class that implements this interface:
And that interface extends this super interface:
https://docs.atlassian.com/atlassian-crowd/3.2.0/com/atlassian/crowd/embedded/api/User.html
Which is also extended by this sub interface:
https://docs.atlassian.com/atlassian-crowd/3.2.0/com/atlassian/crowd/model/user/TimestampedUser.html
Therefore, if you are lucky, then the creation date would be available via this expression:
def x = user.createdDate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.