Can we use " for loop" in REST API program, to get Multiple Sub-tasks for an Issue ?
Below code i have used for this
REST API code:
{
"fields":
{
"project":
{
"key": "TEST"
},
"parent":
{
"key": "TEST-10"
},
for ( int i=1; i <=3; i++)
{
"summary": "Subtask-TEST10",
"description": "Subtask of TEST-10",
"issuetype":
{
"id": "10601"
}
}
}
}
For executing I used curl command:
curl -D- -u admin:admin -X POST --data "@MutlipleSubtask.txt" -H "Content-Type: application/json" http://localhost:8081/rest/api/2/issue/
Could someone help me with it?
And also is there any other way to do it in RESTAPI?
Thanks in Advance
Community moderators have prevented the ability to post new answers.
Hi @Siva Anantha Satyanarayana Singamsetti ,
you may need to go with following rest api endpoint POST /rest/api/2/issue/bulk
Refer this page for more details: https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/?&_ga=2.142165051.860651512.1572849788-2006055560.1571762377#api/2/issue-createIssues
BR,
Leo
Thanks Leo, it worked.
Its a very good useful Link
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.