Forums

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

How could I get users not using Jira for a period of time?

Jose Lezana November 6, 2018

I would like know if there is a way to get all user not using Jira for more than 18 month. Is there any query or methood to get it?

2 answers

2 accepted

0 votes
Answer accepted
Jose Lezana November 7, 2018

Hi Alexey, I´m using below query 

SELECT d.directory_name AS "Directory",
u.user_name AS "USER",
from_unixtime((cast(attribute_value AS UNSIGNED)/1000)) AS "Last Login"
FROM cwd_user u
JOIN (
SELECT DISTINCT child_name
FROM cwd_membership m
JOIN licenserolesgroup gp ON m.parent_name = gp.GROUP_ID
) AS m ON m.child_name = u.user_name
JOIN (
SELECT *
FROM cwd_user_attributes
WHERE attribute_name = 'login.lastLoginMillis'
) AS a ON a.user_id = u.id
JOIN cwd_directory d ON u.directory_id = d.id
ORDER BY "Last Login" DESC;

 

But I´m also getting results for people who has login today, What should I change to get only people not having login for last 18 month?

0 votes
Answer accepted
Alexey Matveev
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.
November 6, 2018

Hello,

You can get users last login date and select only users, who logged in to Jira for more than 18 months ago.

You could find more info here:

https://confluence.atlassian.com/jirakb/retrieve-last-login-dates-for-users-from-the-database-363364638.html

Alexey Matveev
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.
November 7, 2018

Have a look at the Last Login value type. And add a where clause to your query

Suggest an answer

Log in or Sign up to answer