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.
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
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.