I’m trying to create a jira issue with a jira addon I’m developing but keep receiving ‘401 Unauthorized’ error when posting to the url. Other request I’m doing, like searching issues or getting a list of issue types work. Is there anything I’m not aware of that’s different for POST requests?
This is the request:
curl --request POST \
--url <BASE_URL>/rest/api/2/issue \
--header 'Accept: application/json' \
--header 'Authorization: JWT <TOKEN>' \
--header 'Content-Type: application/json' \
--data <SEE BELOW>
This is the data:
{
"fields": {
"project": {
"key": "TEST"
},
"summary": "This is a test title",
"description": "With some description",
"issuetype": {
"name": "Bug"
}
}
}
This is the content of my JWT token:
{
"iss": "jira.app",
"sub": "admin",
"qsh": "86b803b109338286ccafd963279ad7c7c8aa6b62397acb179faf24a5323b218f",
"context": {
"user": {
"userKey": "admin",
"username": "admin",
"displayName": "Sijmen"
}
},
"iat": 1525982996,
"exp": 1525983176
}
It’s annoying that the API is only returning 401 but I’m unable to figure out why, since other request (that also require auth) are working.
Thanks in advance for your help!