The audit logs in Jira can keep track of changes to user management, but they don't actually track when users last logged into the site. For that purpose, you might have better luck trying to follow the KB Retrieve last login dates for users from the database.
You should be able to use the SQL queries on that KB in order to generate a list of users that have at least had a log in to Jira within a specific time period. However you would need to directly access the database Jira is running on for this to work.
I hope this helps.
Andy
Hi Vivuu,
The KB article I linked does include MS SQL specific queries for this: Retrieve last login dates for users from the database.
Please note that this KB has different queries to run depending on what version of Jira you're running. If you are using Jira 6.2 or higher on MS SQL the query would look like this:
SELECT d.directory_name AS "Directory",
u.user_name AS "Username",
DATEADD(second, cast(attribute_value as bigint)/1000,{d '1970-01-01'}) AS "Last Login"
FROM dbo.cwd_user u
JOIN (
SELECT DISTINCT child_name
FROM dbo.cwd_membership m
JOIN dbo.globalpermissionentry gp ON m.parent_name = gp.GROUP_ID
WHERE gp.PERMISSION IN ('ADMINISTER', 'USE', 'SYSTEM_ADMIN')
) AS m ON m.child_name = u.user_name
LEFT JOIN (
SELECT *
FROM dbo.cwd_user_attributes ca
WHERE attribute_name = 'login.lastLoginMillis'
) AS a ON a.user_id = u.ID
JOIN dbo.cwd_directory d ON u.directory_id = d.ID
ORDER BY "Last Login" DESC;
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can we get this done by using DB query ?
We are using MSSQL and Can you share us the query to achieve that.
DBnames
Jira_DB
Jira version - 7.1.9
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As @Andy Heinzer stated, the statements are referenced in the KB linked in his response.
MSSQL is
SELECT cwd_user.user_name, dateadd(second,cast(cast(cwd_user_attributes.attribute_value AS nvarchar(255)) AS bigint)/1000,'19700101 00:00:00:000')
FROM cwd_user, cwd_user_attributes
WHERE cwd_user.id = cwd_user_attributes.user_id AND cwd_user_attributes.attribute_name = 'login.lastLoginMillis'
CCM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
In the users list (site administration) you have the last time they were logged in. In the right corner of the page you have an export available
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andreia,
thanks for the suggestion. However we are not getting any option for exporting.
our jira version is 7.1.9
note:-we only need the reports for last 30 days
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.