The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

REST API Use with cURL

Fariha Raza
June 21, 2021

I'm new to APIs and how it is implemented in Jira. I've read the articles online, but I am having some issues accessing the localhost. How can I use the API with cURL to create an issue?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Hyrum Steffensen {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 21, 2021

Hello Fariha,

See this REST API documentation on creating an issue. Create a an API token here. I found it easies to use Postman to generate the authorization hash. Choose basic authorization and enter your Atlassian username and API token. See this on generating curl code in Postman.

A basic curl script looks something like:

curl --location --request POST 'https://<your prefix here>.atlassian.net/rest/api/2/issue' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <auth hash goes here>' \
--data-raw '{
"fields": {
"summary": "summary goes here",
"issuetype": {
"id": "10002"
},
"project": {
"id": "10000"
}
}
}'

Please let the Community know how it goes.

Regards,

Hyrum

Fariha Raza
June 22, 2021

Thanks for the response! I have created a token. I'm running into the issue where the localhost is not being found when I put in that. For instance, when I press "Send" in Postman, it says "Could not get any response." Is this an issue with not having started Jira or something?

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events