I'm looking for a example to create a sub-taks with Json using the REST api in Jira. Is there a example how the json data should look like?
Community moderators have prevented the ability to post new answers.
Hey, in JIRA prior 5.0 you cannot create issues (which includes sub-tasks) via REST API.
In 5.0 you can create sub-task via REST using the same URL as for normal issue.
Just provide parent field with id or key and then REST plugin will create a sub-task rather than an top-level issue.
E.g. POSTing the following JSON to /rest/api/2/issue should create a sub-task
{ "fields":{ "parent":{ "id":"10010" }, "project":{ "id":"10000" }, "summary":"a sub-task of my first issue", "issuetype":{ "id":"5" }, "assignee":{ "name":"fry" }, "reporter":{ "name":"farnsworth" }, "priority":{ "id":"1" }, "labels":[ "abc", "def" ], "timetracking":{ "originalEstimate":"120", "remainingEstimate":null }, "security":{ "id":"10000" }, "versions":[ { "id":"10000" } ], "environment":"environment", "description":"description", "duedate":"2011-03-11", "fixVersions":[ { "id":"10001" } ], "components":[ { "id":"10000" } ] }, "transition":null }
provided that issue with id 10010 already exists. and all other params are OK.
JIRA 5.0 RC1 released a few days ago should support it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to update the subtask? Is there any reference for JSON representation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
put https://url/rest/api/2/issue/(subtaskId)
{
"fields": {
"parent": {
"Key": "A Subtask created "
},
"summary": "A Subtask created by project key through rest api "
}
}
This will help you to update the summary of the subtask
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.