I want to identify which users have not logged in past 12 months (JIRA)

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2014

I want to identify which users have not logged in past 12 months .

Which database table stores the last logged in date/time information?

I am on jira 6.1

Rahul

2 answers

1 accepted

1 vote
Answer accepted
Vijay Khacharia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2014
Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 10, 2014

thanks Vijay that helps

3 votes
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 7, 2014

Hi Rahul

I've been trying this locally, and the following query should return you a list of users who have either not logged into JIRA at all, or have not logged in after Jan 1st:

SELECT  u.user_name as "Username", 
	u.display_name as "Full Name", 
	to_timestamp(CAST(a.attribute_value as bigint)/1000) as "Last Login" 
FROM cwd_user u
	LEFT JOIN cwd_user_attributes a ON u.id = a.user_id AND attribute_name = 'login.lastLoginMillis' 
WHERE a.attribute_value >= '1388541600000' OR a.attribute_value IS NULL
ORDER BY a.attribute_value;

<sup>I've created this using PostgreSQL, so it may need changes if using different DBMS.</sup>

If you want to change the date, simply change the value in the WHERE clause to a different date (in milliseconds). The following website come in handy to convert the date to milliseconds: http://www.ruddwire.com/handy-code/date-to-millisecond-calculators/.

I hope this helps! :)

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2017

For reference, the MYSQL query looks like this:

SELECT  u.user_name as 'Username', 
u.display_name as 'Full Name',
from_unixtime((cast(attribute_value AS UNSIGNED)/1000)) as 'Last Login'
FROM cwd_user u
LEFT JOIN cwd_user_attributes a ON u.id = a.user_id AND attribute_name = 'login.lastLoginMillis'
WHERE a.attribute_value >= '1388541600000' OR a.attribute_value IS NULL
ORDER BY a.attribute_value;

 

 

Like Charan Nagaraja likes this

Suggest an answer

Log in or Sign up to answer