Hi,
I try to develop a plugin and I need to know the creation date of each user. I don't think that it's possible using java classes so I try to use ActiveObject but I didn't know how to do that.
Can somebody help me?
Regards
Hello,
You can do it like this:
import com.atlassian.jira.component.ComponentAccessordef users = ComponentAccessor.getOfBizDelegator().findAll("User");def usernames=new ArrayList<String>();users.each{user ->usernames.add(user.getString("createdDate"))}return usernames;
Thank you for your answer.
I have just one more question. What is the type of users ? I use java so I need the type.
Can you help me?
List<GenericValues>
ok thank you.
I ran the following in ScriptRunner console:
The output appears to return the create date, but does not return the users names for some reason, can anyone assist?
Thanks!
Hello Sam,
With this simple modification you could get the Username and CreatedDate
import com.atlassian.jira.component.ComponentAccessordef users = ComponentAccessor.getOfBizDelegator().findAll("User");
def usernames=new ArrayList<String>();
users.each{user ->
usernames.add(user.getString("userName"))usernames.add(user.getString("createdDate"))}
return usernames;
That worked! Thank you so much!!!
@Nicolás Figueroa Your help is much appreciated.
How would I edit the script to return just active users? I can't seem to find the solution.
Anyone know how to get the user's created date in Confluence?
There is now a feature request (https://jira.atlassian.com/browse/JRASERVER-74496) in Atlassian's backlog to get the method getCreatedDate() added to one of the existing user objects: com.atlassian.jira.user.ApplicationUser or com.atlassian.crowd.embedded.api.User.
Anybody coming to this community article and interested in having the method added please vote the request to get traction!
Please ignore this answer as it was pasted on the wrong page. (Sorry!)
It looks like you're new here. Sign in or register to get started.