Is there any way to find the inactive users and deactivate their account in Jira and Bitbucket
Asked by Mahesh Kumar:

Is there any script or automation to find the inactive users and deactivate the accounts of unused users


Answers:
author: Ed Letifov _TechTime - New Zealand_
body: Hello, [@Mahesh Kumar](/t5/user/viewprofilepage/user-id/5598784)

Install our app [User Management for Jira](https://marketplace.atlassian.com/apps/1215285/user-management-for-jira-automated-user-access-management?hosting=cloud&tab=overview&utm_source=community&utm_medium=answer&utm_campaign=usermanagement-cloud&utm_term=find+inactive+users) into your Jira Cloud on a 30-days trial, connect to your Organisation [with an API key](https://support.atlassian.com/organization-administration/docs/manage-an-organization-with-the-admin-apis/), and you should able to find users who have not been active in Cloud in general, or in Jira specifically or in Bitbucket specifically and de-license them or suspend or deactivate.

Use our [User Insights](https://techtime.co.nz/display/TECHTIME/User+Management+-+User+Insights+Report+Cloud?utm_source=community&utm_medium=answer&utm_campaign=usermanagement-cloud&utm_term=find+inactive+users) chart or go to [Bulk User Actions](https://techtime.co.nz/display/TECHTIME/Bulk+User+Actions+How+to+Configure?utm_source=community&utm_medium=answer&utm_campaign=usermanagement-cloud&utm_term=find+inactive+users) to dig deeper with various filters.

Reach out to our **24x7 support** if you have any questions via chat on the [website](https://techtime.co.nz/?utm_source=community&utm_medium=answer&utm_campaign=usermanagement-cloud&utm_term=find+inactive+users) or [Service Desk](https://techtime.co.nz/support?utm_source=community&utm_medium=answer&utm_campaign=usermanagement-cloud&utm_term=find+inactive+users).


author: Mehmet A _Bloompeak_
body: Hi [@Mahesh Kumar](/t5/user/viewprofilepage/user-id/5598784) ,

There is no direct way of doing this in Jira.

The solution provided by [@shiva kumar Gosul](/t5/user/viewprofilepage/user-id/4674204) lists the issues and then you can check the assignee columns to see the inactive users. However, it will not show the inactive users who are not assigned to any issue.

You need to fetch all users via below rest api and then filter the inactive ones. The rest api has pagination, it takes 50 users on each page. You need to modify the startAt parameter if you have more than 50 users.

```
/rest/api/3/users?startAt=1
```

![inactive user.png](https://community.atlassian.com/t5/image/serverpage/image-id/348806i5D16A486DF0F02CA/image-dimensions/528x137?v=v2 "inactive user.png")

Using rest api requires some coding. As an alternative you can try [Manage Users for Jira Cloud](https://marketplace.atlassian.com/1224410) app developed by our team.

With this app, you can periodically check your users' status and rights to make sure that product access is limited to those who still have a valid business purpose and they have access only to what they need.

You can;

* List all users, search and sort them by name, active status, last activity time
* Activate/deactivate users individually or in bulk
* Grant/remove access individually or in bulk
* Increase your security and manage your cost more effectively

Hope it helps.

comments: author: shiva kumar Gosul
body: Hi [@Mehmet A _Bloompeak_](/t5/user/viewprofilepage/user-id/3740047)   

To optimize our process, we proactively identify inactive users with assigned issues and reassign them to active users. If you wish to specifically view inactive users, a simple query can provide the necessary information.

**project level**

project = "ABC" AND assignee in inactiveUsers()

**Team level**

IT Team = "XYZ" AND assignee in inactiveUsers()


author: Mehmet A _Bloompeak_
body: Hi [@shiva kumar Gosul](/t5/user/viewprofilepage/user-id/4674204) ,

Your approach is helpful for detecting issues assigned to inactive users. In your terminology inactive users are the ones that do not have access to Jira anymore. They were deactivated by the Jira admin via user management page.

I guess what [@Mahesh Kumar](/t5/user/viewprofilepage/user-id/5598784) is asking different. He is looking for a way to detect users who haven't logged in to Jira for a long period of time(e.g in the last 90 days). So that, he can deactivate their accounts. In his terminology inactive users are the ones who did not logged in to the Jira for a long time.


author: shiva kumar Gosul
body: [@Mahesh Kumar](/t5/user/viewprofilepage/user-id/5598784)

There is a method to track inactive users in Jira. Please refer to the following JQL query. I've included statuses to help you easily identify open or in-progress issues assigned to inactive users.

assignee in inactiveUsers() and status not in (closed, Abandoned, Cancelled, Complete)


Tags: cloud

jira-cloud