Hi All,
I have recently started interacting with JIRA Rest APIs and I am simply trying to create an ISSUE for a particular PROJECT.
I get a response which specifies what issue types exist in the project, and I try to use the TASK with id 10002 as the parent for the issue I am trying to create.
Here is the response I get about the project for reference,
But when I do this, I get the below response.
{ "errorMessages": [], "errors": { "project": "Sub-tasks must be created in the same project as the parent." }}
In both these calls, the project Id is the same.
Can someone please suggest what can be done here?
Much thanks.
Hi @Shiv Kumar
Please share the aPI call details you use, so it can be use to correlate with the error message presented.
Issue type ID is just the the ID to identify what issue type you are using. Base on the error message you are using sub-task issue type(10003) but did you map the newly created sub-task with the actual ID of the unique task you created. That ID is not 10002
Hi @Benjamin, here are the call details:
API : https://xompany.atlassian.net/rest/api/3/issue
type : POST
body : {
"update": {},
"fields": {
"summary": "Testing JIRA API",
"parent": {
"id": "10002"
},
"issuetype": {
"id": "10003"
},
"project": {
"id": "10100"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Order entry fails when selecting supplier.",
"type": "text"
}
]
}
]
},
"labels": [
"JIRA"
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the issue key of issue 10002 and what is the key of project 10100 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
project key: 'SUP',
issue Name: 'Task' //issue does not have a key, but has a 'name' attribute.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's not right.
An issue always has a key, they don't exist without them (or if they do, your database is fried). We need to see the Key of issue 10002.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An Issue does, yes. But I am trying to use An Issue Type as the parent, and this issue type does not have a key.
The image on top shows the issue type 10002 that I am using as the parent for the issue that I am trying to create.
The attachment shows the request body.
If I am doing this wrong all-together, pls do suggest the right way with an example possibly?
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I think you are misunderstanding the issue/sub-task relation.
An issue type can not have sub-tasks. They're not issues, they are an attribute of an issue. Only an issue can have sub-tasks.
You appear to be trying to attach a sub-task to an issue type. Where you're using issue: 10002, that's probably an existing issue in another project, hence the error message.
Try attaching the subtask to an issue in the SUB project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Yes, you are right.
I had misunderstood it.
I had to do Sub-task->Task.
But instead I was doing Sub-task->Issue Type.
Thanks for pointing it out.
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.