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

Creating Sub task of an issue using REST API.

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

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"}
}

why specifically issuetype id is 5 here??

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.

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

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.

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

Is it possible to change the parent of subtask?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
Community showcase
Posted in Confluence

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

129 views 3 7
Join discussion

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