It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Issue type is a sub-task but parent issue key or id not specified.

Hello,

I am trying to create a sub task from rest api. But every time I am getting this error. I know to create a sub task I have to pass PARENT ID/KEY and issue type as Sub-Task (In my case its 10003). But still I am getting this error. Is this is a flaw or I am doing something wrong. Can anybody help me in this. I have posted my json as well. 

 

Thanks

 

 

{
"fields": {
"parent":{
     "key": "UNSP-30" 
 },
"project": {
     "key" : "UNSP"
 },
"issuetype": {
"id": "10003"
},
"priority": {
"name": "High"
},
"summary": "Some text"
}
}

Issue types what I get when I do editmeta of that issue is :

"id": "10002",
"name": "Task",

"id": "10001",
"name": "Story",

"id": "10004",
"name": "Bug",

"id": "10000",

"name": "Epic",

 

Error Message:

{"errorMessages":[],"errors":{"issuetype":"Issue type is a sub-task but parent issue key or id not specified."}}

2 answers

0 votes

I've always done sub-tasks with the key of the parent rather than ID

"project": { "key": "NIC" },

"parent":  { "key": "NIC-456" },

"issuetype": {"id": "5" } ,

"summary....

 

That's working for me.  Id should work too if I understand the docs, but you do need to make sure you give it the issuetype, project and mandatory fields (summary for example) too.

Also, thre's no error in your question?

@Nic Brough [Adaptavist] I tried with key as well but didn't work same result. Issue type is fine. I have seen that in edit issue meta i.e., 10003(for sub task) and summary. But as I know project is not mandatory right?. Is there any other reason?

 

I'm not sure that project is "not mandatory", I've always sent it.  10003 is a funny number, as the system sub-tasks are "5", so I assume you're actually adding a sub-task type you have defined?

Again, you have not told us what the error is?

@@Nic Brough [Adaptavist] I updated my question please check. I am getting the error message which I have updated in my question and I have posted issue types as well. BTW I'm using demo product so may be the issue type and other id's are different.

"other IDs may be different".  Well, yes, that's going to completely break it.  You can't just use ids from one system and assume they're the same in an unrelated one.

{
"self": "http://localhost:8080/rest/api/2/issuetype/10003",
"id": "10003",
"description": "Подзадача запроса",
"iconUrl": "http://localhost:8080/secure/viewavatar?size=xsmall&avatarId=10316&avatarType=issuetype",
"name": "Подзадача",
"subtask": true
},

Only: 10003

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted 6 hours ago in United States

Request a Demo

Questions? Want to see a demo of the Atlassian tools? Add a comment below or Send us an email

43 views 2 1
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you