Hi team,
I am getting the following error while trying to create a sub-task using JIRA REST API
URL: https://MYJIRA.atlassian.net//rest/api/2/issue/
REQUEST BODY:
{ "fields": { "project": { "key": "KEY" }, "parent": { "key": "2134" }, "assignee": { "emailAddress": "xyz@abc.com" }, "reporter": { "emailAddress": "xyz@abc.com" }, "issuetype": { "id":"ISSUEID" }, "summary": "Summary text" , "description": "Description Text" }}
Error:
{
"errorMessages": [ "At least one of 'id' or 'key' is required to identify an issue." ],
"errors": {}
}
Hi Rakesh,
I see that you're using Postman to try to create a subtask in your Jira Cloud site. Given the error you are seeing here it would appear that Jira does not recognize that you have supplied either the issue id or the issue key.
When you create a subtask in Jira, there is a requirement that all subtasks have to have a parent issue. So we have to tell Jira specifically which issue this subtask is a child of when it is created. In your example, you have
"parent": { "key": "2134" },
But the issue key consists of both the project key + the issue number in that project. So they tend to have a format of ABC-2134. Try changing the payload to look something more like this:
{ "fields": { "project": { "key": "ABC" }, "parent": { "key": "ABC-2134" }, "issuetype": { "id":"10005" }, "summary": "Summary text" , "description": "Description Text" }}
Try that, if it doesn't work let me know what error you get back in response.
Cheers,
Andy
thanks Andy! this works!
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.