Hi,
I have more than 2000 projects in jira.
How to get the project keys for all the project by using a Rest Api?
Thanks,
Ipsita Dash
Hello @Steve Thornhill @Ipsita Dash
Here we are getting all the data but i just need project keys or project names, how do we get it?
This worked for me:
curl -D- -u user:password -H "Content-Type:application/json" -X GET -k https://your-jira/rest/api/2/project 2>/dev/null | egrep -o 'key":"([A-Z]+)"' | cut -f 2 -d: | xargs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even better, use proper json parsing on the output:
curl -s -u user:password -H "Content-Type:application/json" -X GET -k https://your-jira/rest/api/2/project 2>/dev/null | jq -r '.[].key'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This code snippet will point you in the right direction
curl --user email@example.com:<api_token> \ --header 'Accept: application/json' \ --url 'https://your-domain.atlassian.net/rest/api/2/project'
All the calls are documented here - https://developer.atlassian.com/cloud/jira/platform/rest/?_ga=2.220028510.635558710.1519632796-1676897954.1510753882#api-api-2-project-get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve,
Thanks for your reply. Upon running the curl command i am facing an error saying " api_token: No such file or directory" .
How does the above command worked for you.
Thanks,
Ipsita Dash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I am running it on a local server I use the following
curl --user steve --header 'Accept: application/json' --url 'http://localhost:8080/rest/api/2/project'
Substite the user and the url for your own ones.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.