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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

How to write a REST API program to create a Multiple Sub-tasks for an Issue? Edited

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

 

1 answer

1 accepted

0 votes
Answer accepted
Leo Community Leader Nov 08, 2019

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 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,642 views 22 33
Read article

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