Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Create Story with Sub-Tasks via API

I'm scheduling creation of Issues with Sub-Tasks. I plan to do this via API, and have created the JSON file for creating a Story. No problem.

What I'm trying to do now is create a number of Sub-Tasks for that newly created issue. My understanding is that this can't all be done via a single action. If I want to bulk create 5 Sub-Tasks for the story, would I have to do a GET request to return the latest issue created in my project and then insert that via variable into the next POST for creating the Sub-Tasks? All the examples I've found for Sub-Task creation have hard-coded issuekeys in them. 

1 answer

Hello @Dan Bower 

Are you asking a question, or just stating the exact method of how Sub-tasks are created?

PS. There is no need to do a GET after the parent Story is created. When you do the POST to create that Story, its ID is returned in the JSON response, so just parse that bit of data out of the response, then use it in the subsequent POST requests to create the child Sub-tasks.

Question is how do I parse and pass that value? Or does that depend. I'm trying to do this using the Ansible uri module, but am open to alternatives.

Yes, it depends totally on the language / toolset you are using, what form it receives the JSON response and how to manipulate that object and get specific bits of data from it.

I don't use Ansible, so can't help any further, but I'm sure a quick Google search on the topic will yield lots of examples and methods.

Suggest an answer

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

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

835 views 25 28
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