I have created a personal 'API token with scopes' with the following scopes.
read:issue:jira
read:project:jira
read:user:jira
read:user.property:jira
read:user-configuration:jira
read:issue.watcher:jira
write:issue:jira
write:project:jira
write:issue.watcher:jira
export JIRA_EMAIL="<jira user email id>"
export JIRA_TOKEN="<persona API token with scopes>"
export JIRA_SITE_SCOPED="api.atlassian.com/ex/jira/<cloud id>"
With this curl command, I am getting error:
"error":"Not Found","message":"No message available","path":"/ex/jira/<cloud id>/rest/api/3/issue"
Curl command :
curl -v -u "$JIRA_EMAIL:$JIRA_TOKEN" \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
"https://$JIRA_SITE_SCOPED/rest/api/3/issue" \
--data '{
"fields": {
"project": {
"key": "BSAC"
},
"summary": "Sample issue created via curl",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This issue was created using Jira REST API."
}
]
}
]
},
"issuetype": {
"name": "New Hire"
}
}
}'