Forums

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

How to automate getting user logins?

Chris Tolley
Contributor
February 23, 2022

Hi all,

We are in the midst of migrating to Cloud and are exploring automation possibilities for the future.

I can't find a documented REST API call for Jira Cloud that lists user logins by date.

I've found the 'export users' feature in the Admin user directory view, which gives us a CSV of users with their last login dates, which is great. I then used development tools to grab that API call and replicate it in Postman, which worked to list users with logins, but only with a Cookie which was pre-generated from the browser (cached from my login through the browser).

However, I saw that cookie authentication no longer is supported, so I can't generate a session using /rest/auth/latest/session and use the cookie from that, which stops me automating the call above.

I've then also found API documentation for the organisation here for user management:
https://developer.atlassian.com/cloud/admin/user-management/rest/api-group-users/
But it looks like this does not output a last login date.

Can anybody provide a clear solution for grabbing last login date via some python script? It seems like I'm dancing round a potential solution but missing it, if one even exists.

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Prince Nyeche
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 Champions.
February 23, 2022

Hi, according to this document you can query the organization API and the payload shows the last_active key. Also, you can vote for this ticket as there's a feature request on it.

Chris Tolley
Contributor
February 24, 2022

Thanks @Prince Nyeche I missed that. That API call doesn't work for us (we get an empty data response), but I'm going to assume that's due to our organisation not being set up properly yet. I've upvoted that linked ticket, seems like something that needs adding!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events