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?
Community moderators have prevented the ability to post new answers.
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
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?
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.