Jira audit report

We need to provide a audit report to the management on who has accessed the Atlassian tool - Jira in the last 30 days ?

3 answers

1 vote

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

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

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

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

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

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

Jira version is 7.1.9

As @Andrew 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

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,323 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot