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?
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.
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.
That is odd. Having just "com" works for me in my instance.
Hi!
As I see Jira Rst has a parameter
includeInactiveUsers
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py#L101
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/jira.py#L288
Cheers,
Gonchik Tsymzhitov
includeInactive param is deprecated now. What are the possible options here&
any otion ?
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:-
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.
It looks like you're new here. Sign in or register to get started.