Do I retrieve user login dates from the Crowd API or database?

Aaron_Khan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2023

I'm creating an automation Python script that will remove Crowd users that haven't logged in for more than 90 days.

Looking through the Crowd 3.2.3 REST API Reference documentation, I'm not seeing any API endpoints for "lastAuthenticated" or "lastActive" under user attributes. Though, I was able to find an Atlassian Support entry from 2019 titled "How to get last authenticated in confluence using rest api?" where an Atlassian team member explains that a user's last login date won't be available via UI as there is no API endpoint for it and will need to be retrieved from the database.

Because this support entry was from 4 years ago, I wanted to ask if accessing the Crowd database is still the recommended way of retrieving user login dates.

Thank you for your time!

1 answer

1 accepted

0 votes
Answer accepted
Craig Castle-Mead
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.
February 1, 2023

Hi @Aaron_Khan ,

Accessing any content via the database is never the recommended option. There may be changes to the structure with version upgrades, you’d need to reverse engineer the structure of the tables to figure out how to extract the right information - safely and reliably. 

There may be an existing Marketplace app that does what you’re looking for too, not sure if you’ve checked out that path.

That being said, sometimes certain data you need/really want is not exposed via a REST API, so you’re left with two options.

1 - the “proper” way, build your own add on that uses the relevant Java APIs to extract the data and then expose this via a REST API

2 - access the data via the database, only use read only access when doing this, never write changes back to the database as this will only cause issues and headaches. This approach is at your own risk.

 

CCM 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events