Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i automatically create a Story and sub-tasks under the story on epic transition

Shivani Bhosale January 27, 2019

I would like to add a workflow post-function such that whenever an Epic is created, a story and a set of subtasks under the story get created automatically.

I checked the Jira Misc Workflow Extensions add-on but unable to find such a feature.

Can you suggest any other add-on to achieve this.

3 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
January 28, 2019

JMWE can actually do that. 

Are you on Jira server or cloud?

Shivani Bhosale January 28, 2019

Hi David,

Thanks for the prompt reply.

I am on Jira Server.

My requirement is as below. 

Whenever an Epic is created - > [ Story 1 -> Subtask 1, 2, 3, 4, 5 ] should be automatically created. 

I tried doing it using JMWE in the iterator script, but only one issue type seems to be handled in one post function. Can JMWE handle multiple issue types in one post-function. If so, can you post an example configuration for the same. Thanks in advance.

Shivani Bhosale January 28, 2019

I was able to generate the Story - > Multiple Sub-tasks by adding 2 "Create/Clone" post-functions, one each for story and and sub-tasks. 

My next issue is setting the Summary of the multiple Sub- tasks. 

I checked the "Multiple Issue Creation" box and entered the following in the Iterator

[[summary:"Analysis"], [summary:"Design"]]

Under the 

Set fields of new issue - > Summary 

I am trying to use the it.summary variable to access the array set in Multiple Issue Creation. But the values are not getting picked up. Could you please give me examples of "it variable" usage for the iterator summary values.

David Fischer
Community Champion
January 29, 2019

If you kept the configuration for the Summary field as it is by default, then it is expecting a Groovy template. In a Groovy template, you can access your "current" summary this way:

${it.summary}

Note that if only the summary changes, you can simplify your iterator this way:

["Analysis","Design"]

and use 

$it

in the summary.

Shivani Bhosale January 29, 2019

Thank you David. I had tried $it but it gave an error when i tested the script. But when the issue actually got created it worked fine. Makes sense. 

Thanks a lot for your suggestions.

Kshitij March 6, 2019

Hi Shivani, How did you create Epic - > Story 1,2 -> Subtask 1, 2, 3, 4, 5 ] automatically ?

Like Yossi Vaknin likes this
0 votes
Oluwaseun Popoola
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 2, 2025

You could create an automation rule using the epic creation as a trigger. 

I am using the cloud version, so I don't know if the process is the same.
Goto the project setting, select automations and create a rule. 

You rule would be that when an epic with the specific component is created (Create a component for the epic first), a story is then created with its properties of course. And under the story, you should create the sub-tasks as well in the same manner. When you activate this rule, it will create a story and it's sub-tasks every time an epic with the component is created.

0 votes
Sima Jamshidi November 16, 2021

Hello,

I would like to do the same as @Shivani Bhosale mentioned: "Whenever an Epic is created - > [ Story 1 -> Subtask 1, 2, 3, 4, 5 ] should be automatically created. "

And the Sub-Tasks should be under the story not under the epic.

Is there a way to do this without JMWE? In our project we're using JSU and ScriptRunner.

Thanks in advance for any support

Suggest an answer

Log in or Sign up to answer