Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to disable user who have not logged in for past 2 years

OMom2019 February 21, 2020

Need to disable user who have not logged in for past 2 years in jira. Please help. I need select query for this.

I used various query but I was not getting this select query result correctly.

 

Thanks in advance.

1 answer

0 votes
JP _AC Bielefeld Leader_
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.
February 21, 2020

Hi,

with MySQL you can use:

SELECT cwd_user.display_name as Name,cwd_user.user_name as Username, FROM_UNIXTIME(cwd_user_attributes.attribute_value/1000) AS "Last Logged in on"
FROM cwd_user, cwd_user_attributes
WHERE cwd_user.id = cwd_user_attributes.user_id AND cwd_user_attributes.attribute_name = 'login.lastLoginMillis'
AND FROM_UNIXTIME(cwd_user_attributes.attribute_value/1000) < "2018-02-18 00:00:00.000000"
ORDER BY cwd_user_attributes.attribute_value DESC

Not sure about other SQL dialects. You should consult the specific database documentation on converting cwd_user_attributes.attribute_value to a comparable timestamp.

Best

JP

Suggest an answer

Log in or Sign up to answer