Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Shell script to get Jira user list

Sanjana Sen March 16, 2022

I am new to automation and jira. My company has asked to write a script to get all user list using Jira Rest API. via mobaxterm. I referred the following document:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-users-search-get

The following curl command is given to get the all users list but its not working:

curl --request GET \ --url 'https://your-domain.atlassian.net/rest/api/3/users/search' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'

Do I need to add anything else in the script? Please anyone provide the full script if possible.

 

P.S We use have jira on server

1 answer

0 votes
Stefan Salzl
Community Champion
March 16, 2022

Hi @Sanjana Sen 

  • Did you create a token for a user with sufficient rights?
  • Did you provide the authorization to your call (correct user and api token)?
  • Could you provide the error that is returned on your call?

Best
Stefan

Sanjana Sen March 16, 2022

@Stefan Salzl I didn't create any token or authorization. Please suggest how to do that.

Thanks,

Sanjana

Stefan Salzl
Community Champion
March 17, 2022

It´s perfectly described in the documentation. See the following Link:

https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

 

Best
Stefan

Suggest an answer

Log in or Sign up to answer