Jira REST API: How to get all inactive users

Rich Scire March 16, 2016

How can I get all inactive users with the JIRA REST API?

The /rest/api/2/user call requires a user name rather than letting an empty user name result in all the users.

The /rest/api/2/user/search also requires a username. Does this accept a regex like .* or something similar to specify all users?

How can I get all the users?

2 answers

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2018
Roman Melnyk April 23, 2019
includeInactive param is deprecated now. What are the possible options here&

Like furkan.ali likes this
furkan.ali May 2, 2019

any otion ?

Roman Melnyk May 3, 2019

In my case I get users from tempo and then using user account_id get full info from Jira Api.

Option 1:

With the accountID information, you can retrieve the user by using the same GET /rest/api/3/user API. Each GET request will return one user information. For example as below:-

  • Request
  • Response

If you would like to bulk getting the user result , use GET /rest/api/3/user/bulk API. Just insert & symbol. For example ,

accountId=99:27935d01-92a7-4687-8272-a9b8d3b2ae2e&accountId=26912:8347-325f-ef346-bd0342234324

For more information , can refer to this documentation.

Both API can be use to retrieve active and inactive user. 

 

Option 2:

If you have admin access and csv file is ok for you than this option is for. But not in my case.

  1. Go to User Administration screen
  2. Click on Export users in the top-right of the page to get a CSV file with your users' information
  3. Select All users to get all the users (actives and inactives) and click on Download file
0 votes
Curtis McDonald March 16, 2016

It doesn't appear the API supports just a query for all, at least, not directly as it doesn't support a regex value.

The 'username' parameter does search the email address. If all accounts are within your company, then all emails should have the same domain, which a search on that would return everyone. You could also just use ".com", and repeat for all the ones existing in your instance.

If this isn't an option, you could use the Group endpoint if all the users are assigned groups when added into Bitbucket.

Rich Scire March 16, 2016

Thanks for the suggestion. The search seems to only look at the email up to the @. I searched for com and the only return was 1 user that happened to have com in his name. It did not search the domain.

This was an excellent suggestion but it doesn't seem to work.

Curtis McDonald March 16, 2016

That is odd. Having just "com" works for me in my instance.

Suggest an answer

Log in or Sign up to answer