Forums

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

I want to develop a plugin to remove users from JSM sites based on last active

d.b.kumar.chauhan
March 23, 2026

Hi everyone,

I want to develop a plugin to remove users from JSM Cloud sites based on their last activity. Could anyone help me with the following points?

How can we fetch all users along with their timestamps?

How can we create a Forge plugin that triggers automatically?







1 answer

0 votes
Kai Krause
Community Champion
March 23, 2026

Hi,

you can combine two endpoints from the 

The Organizations REST API REST API 

Get all users from your org

https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v2-orgs-orgid-directories-directoryid-users-get

and then get all timestamps

https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v1-orgs-orgid-directory-users-accountid-last-active-dates-get

and then remove 

https://developer.atlassian.com/cloud/admin/organization/rest/api-group-users/#api-v2-orgs-orgid-directories-directoryid-users-accountid-delete

To run automaticly you can use the 

Scheduled trigger

I think it would be good  to

  • Never immediately delete users
  • First log them
  • Optionally notify admins
  • Maybe deactivate instead of delete
  • Respect GDPR

 

Recommended approach:

  1. Detect inactive users
  2. Store list in Forge storage
  3. Send email via notification
  4. Remove after X days grace period


    BR
    Kai 

 



Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events