Find inactive users in Jira and Confluence with a script
Atlassian Cloud bills per user, so people who left the project months ago still cost money every month. This free script lists every user of your organization with the last day they used each product, and flags those inactive for 90 days or more. It only reads; it changes nothing.
What you need
- Organization admin rights on admin.atlassian.com.
- Your organization ID (it is in the address bar of admin.atlassian.com:
/o/<org id>/). - An organization API key: admin.atlassian.com → your organization → Organization settings → API keys → create an API key with scopes (the key is shown once). Give it the shortest expiry you are comfortable with, and revoke it when you are done.
- Node.js 18 or later.
Run it
Download find-inactive-users.mjs (MIT licence), then:
ATLASSIAN_ORG_ID=your-org-id ATLASSIAN_ADMIN_KEY=your-key \ node find-inactive-users.mjs --days 90 --out inactive-users.csv
It prints a one-line summary and writes a CSV with one row per user and product: account ID, email, status, product, last active date, days inactive and an inactive column (yes, no, or unknown when Atlassian gives no date). The file holds your colleagues' emails, so keep it private.
How it works
- List the users.
GET https://api.atlassian.com/admin/v1/orgs/{orgId}/usersreturns each user withaccount_statusandproduct_access, where each product carries alast_activedate. The script follows thelinks.nextcursor until every page is read. - Fill the gaps. For an active user whose product list comes back empty, it also asks
GET /admin/v1/orgs/{orgId}/directory/users/{accountId}/last-active-dates, one call per user, paced to stay under that call's limit of 200 a minute per organization, and waits when the API answers 429. - Flag. A user is inactive on a product when the last active date is 90 days ago or more (change it with
--days). No date at all is markedunknown, not inactive: Atlassian returns no date for a user who has not opened a product. Check those by hand.
Two things to know about the data: Atlassian may take up to 24 hours to update last active dates, and a user counts as active from a brief page view. A date from yesterday means "opened something", not "works here".
Before you remove anyone
Inactive is not the same as wasted. Check these first:
- People on leave (parental, sick, sabbatical). Removing access and re-adding it later is fine, but tell them.
- Approvers and occasional users who log in once a quarter for a sign-off. A 90-day window flags them; a 180-day window may not.
- Service and integration accounts. Some never show activity in the product UI but still need access.
- Billing cycles. On a monthly plan the next bill follows the user count; on an annual plan you keep paying for your user tier until renewal, so time the clean-up before it.
- Suspend or remove product access; don't delete the account. Their issues, comments and pages keep their name, and access can be given back.
Doing this every month
The script is a one-off snapshot. If you want the same check on a schedule, with a review step before anyone loses access and a record of what was changed, the Inactive User License Optimizer reads every product's last active dates once a day, proposes the people with no activity anywhere for the days you choose, and suspends only those an organization admin approves. Suspended users lose access (check your Atlassian bill for how they count), and each one can be restored from the admin.
Inactive User License Optimizer, by Sweekly Apps LLC