Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JIRA REST API get all users

I'm trying to get all users from JIRA REST API. I need to save all users to my Database from my own java client. Is it possible to do that ?

If so how we going to do that?

like image 493
Hasitha Weerasinghe Avatar asked Oct 11 '14 14:10

Hasitha Weerasinghe


2 Answers

You can get all users that are assignable to a specific project. If everyone is assignable you will get all users.

/rest/api/2/user/assignable/search?project=PROJECT

Curl:

curl -D -u USERNAME:PASSWORD -X GET -H "Content-Type: application/json" https://company.atlassian.net/rest/api/2/user/assignable/search?project=PROJECT
like image 155
Ogglas Avatar answered Oct 15 '22 13:10

Ogglas


One possible way to get all of the users in your JIRA instance is to use the Crowd API's /rest/usermanagement/1/search endpoint:

curl -X GET \
  'https://jira.url/rest/usermanagement/1/search?entity-type=user&start-index=0&max-results=1000&expand=user' \
  -H 'Accept: application/json' -u username:password

Do note that you'll need to create a new JIRA User Server entry to create Crowd credentials (the username:password parameter above) for your application to use in its REST API calls:

  • Go to User Management.
  • Select JIRA User Server.
  • Add an application.
  • Enter the application name and password that the application will use when accessing your JIRA server application.
  • Enter the IP address, addresses, or IP CIDR block of the application, and click Save.
like image 20
Adil B Avatar answered Oct 15 '22 15:10

Adil B