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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

148 views 5 9
Read article

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