Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Creating Sub task of an issue using REST API.

asas asdsd April 19, 2012

Hi,

I'm trying to make an issue and using parent id in it to make the new issue as a child of the previously created

issue.This is the JSON string i'm using.

{"fields":{"parent":{"id":"10420"},"project":{"id":"10300"},"summary":"a test sub-task of my first issue","issuetype":{"id":"3"},"description":"description"}}

The output coming is :-Failed : HTTP error code : 400

Can somebody tell me the possible mistake i'm making.

thanks

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 21, 2012

The JSON you specified is almost correct, you just need to specify the sub-task issue type (5), not the task issue type (3)

So the following should work:

{"fields":
   {"parent":{"id":"10420"},
   "project":{"id":"10300"},
   "summary":"a test sub-task of my first issue",
   "issuetype":{"id":"5"},
   "description":"description"}
}

Taleev.Aalam@mindtree.com September 25, 2018

why specifically issuetype id is 5 here??

G V Shabareesh October 10, 2018

when i am giving the issue type as 5 and it is saying that issue type is mismatched give the correct one... issue type : 'name':'task' or 'sub-task'.

 

please help me friends.

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2019
0 votes
Chidambaram C July 30, 2013

Is it possible to change the parent of subtask?

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2012

https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue#JIRARESTAPIExample-CreateIssue-Exampleofcreatingasub-task

says that you have to use the issue key in the parent dictionary. And indeed the id did not work for me, but the issue key did work. Sub-issues are currently added to the end of the list of existing sub-issues.

Kavian Moradhassel April 18, 2013

Actually, an ID will work as well, but you have to quote it as a string.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 21, 2012

Isn't the parent has to be the parent the issue key?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events