Hello all,
We are Jira Cloud users. Reaching out to you all with few queries
1. How to get the list of Inactive users?
2. We are creating a POC for automating 'Inactivating user record(s)' using Informatica. This is to replace a manual process. How to obtain the 'Last Modified By' and 'Last Modified Date' of an Inactive user record?
3. How to activate an Inactive user in Jira Cloud instance (for testing purpose)?
I see that there are several apps out there for 'Managing Inactive users for Jira' but would prefer a solution without having to install any app.
Any help is highly appreciated!
Thanks in advance!
Thank you @Mykenna Cepek for such detailed & prompt response! Let me try out Jira Cloud REST API calls & will share my findings.
I also noticed that the Jira Cloud REST API does include some access to the Jira Audit Log:
There might be some data in there about who changed User Records.
More about the Audit Log in general here:
https://support.atlassian.com/jira-cloud-administration/docs/audit-activities-in-jira-applications/
To retrieve a comprehensive list of users, use this RESTAPI endpoint, substituting your site GUID in the {SITEGUID} field
https://admin.atlassian.com/gateway/api/adminhub/um/site/{SITEGUID}/users?count=100&start-index=1
Users can only be gathered 100 at a time, so increment the "start-index" field by 100 each time until all records are received.
Each JSON record returned has an "activeStatus": field that returns either "DISABLED" or "ENABLED". This answers point (1) above.
Also, each record also contains a "presence" field that is the last login time:
"presence": "2021-09-17T12:28:53.653554Z"
That answers point (2) above.
To activate an inactive user, use this RESTAPI point:
POST to:
https://admin.atlassian.com/gateway/api/users/{USERGUID}/activate
https://admin.atlassian.com/gateway/api/adminhub/um/site/{SITEGUID}/users/{USERGUID}/deactivate
@Mark Simpson Great answer. Can you point us to some online documentation for this Admin API? It appears to be separate from the normal Jira Cloud REST API.
Thanks @Mark Simpson, but I don't see the /api/users and /api/adminhub requests documented at that link.
@Mykenna Cepek - from my notes, I can only find references to other community posts where these RESTAPI endpoints are mentioned. Indeed, in the first post Petter Gonçalves from Atlassian suggests that "the endpoint is not official, not documented, and may change over time."
For user retrieval my starting point reference was:
For deactivating users, I found this syntax here:
Best,
Mark
This sounds like a concern for some standalone automation. From @Mark Simpson's first link above:
...as a possible workaround, you can grab the cookie from an active site-admin session from the browser and then use it to authenticate a REST API POST request...
and:
...this is just a workaround, the endpoint is not official, not documented, and may change over time.
Cookies expire, of course. This doesn't sound like a solid option for a general desire to help "managing users".
But this approach might be ok for a manual, one-time (or occasional) thing -- some bulk cleanup, for example.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Become an effective Jira admin
Manage global settings and shared configurations called schemes to achieve goals more quickly.
Streamline Jira administration with effective governance
Improve how you administer and maintain Jira and minimize clutter for users and administrators.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.