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

1 vote
nic Community Leader Apr 15, 2016

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?

 

nic Community Leader Apr 15, 2016

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.

nic Community Leader Apr 15, 2016

"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
Community showcase
Posted in United States

Live! - Austin ACE -- Summer BASH 2019

Hey Austin! Come join us for our 2019 Atlassian Community Summer BASH as we transition ourselves into party status! Bring an attachment, log a great time, and collaborate with new friends as we celeb...

23 views 0 0
View post

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you