When attempting to use CURL to create a new Jira Story, I am receiving the following error:
"405 - HTTP verb used to access this page is not allowed."
Here is what I am passing:
curl --request POST --url https://domain.atlassian.net/rest/api/3/issue/ --header Authorization: Bearer <api_token> --header Accept: application/json --header Content-Type: application/json --data { <data> }
And the <data> being sent is JSON, like this:
{
"fields": {
"project": {
"key": "key"
},
"summary": "summary",
"description": "description",
"issuetype": {
"name": "Bug"
},
"customfield_10200": "data"
}
}
I suspect there is some authentication missing from the Jira side, but I am not entirely sure. My first time attempting to write a script to create a Jira Story.
I discovered that I was not properly base64 encoding my user and API token. I also found that I was using Authorization: Bearer when I should have been using Authorization: Basic.
These changes resolved my issue.
I have also tried using this:
--user <username>:<api_token>
Instead of this:
--header Authorization: Bearer <api_token>
As I have done anything with OAuth for REST APIs in Jira. Perhaps that's what I am missing, but that seems to be more about add-ons than scripts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.