Query for getting all Jira active users and their last login date

Hi,

I am trying to run this query I found in the discussions, but it doesn't work:

SELECT cwd_user.lower_user_name , cwd_user.display_name,  to_date('01.01.1970','dd.mm.yyyy') + to_number(cwd_user_attributes.attribute_value)/1000/60/60/24 AS last_login

FROM cwd_user, cwd_user_attributes WHERE cwd_user.id = cwd_user_attributes.user_id AND cwd_user_attributes.attribute_name ='login.lastLoginMillis' AND cwd_user.ACTIVE ='1

Seems that this part is not working:

to_date('01.01.1970','dd.mm.yyyy') + to_number(cwd_user_attributes.attribute_value)/1000/60/60/24 AS last_login

Can someone help?

1 answer

0 votes

Hi Orit,

The knowledge base article How to Get a List of Active Users Counting Towards the JIRA application License will show you how to get a list of all active users that count towards the license.

Retrieve last login dates for users from the database will show you how to get the last logins for the users. 

Please keep in mind that if the user has a "Remember Me" token set, then the Last Login date will not reflect the last time the user accessed JIRA, but will instead show the last time they had to go through the login process. See: JRA-60508 for details.

Cheers,

Branden

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,167 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot