Forums

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

Automation to link sub-tasks within an Epic

daniel_jones September 9, 2025

Hello, 
I have need to link many sub-tasks as "is dependent on" both within a story and across several stories within a single Epic.  Currently I have automation to create all of the stories and sub-tasks when a certain Epic is created.  However many of the sub-tasks need to be linked.

I have solved it by once the automation to create the stories and sub-tasks is complete, then doing JQL search by Summary to find each sub-task, creating a variable to hold each sub-task key and linking them.  But there are about 40 sub-tasks and the automation seems cumbersome and takes a while to run.

I was wondering if there is a more efficient way to do this? Maybe with {{lookupIssues}}? to find the sub-tasks all at once?

Or would this be better as a Groovy script in Scriptrunner?

 

Thanks in advance!

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2025

Hi @daniel_jones 

Without seeing the specifics of the rule which creates the subtasks...

You might be able to use the Lookup Work Items action or the Story's smart value {{issue.subtasks}} to do this, and it depends upon two things:

  • How long is the current rule?
    • You describe creating 40 subtasks.  Unless those are all added in one step with the Create Sub-tasks action, your rule likely has 40 Create Issue actions.  In that case, the rule could not branch to each subtask as it would exceed the maximum rule length.
  • How do you determine the dependencies between the subtasks?  Is it only by the Summary?
    • If it is only by the summary, the rule could use list filtering with the lookup result or the subtasks smart value to find the correct key for linking.  If the determination is more complex, branching on JQL would be required, as you are currently trying.

 

Based on the 40 subtasks count, I expect any approach with a single rule will be difficult.  Thus, I recommend investigating the external scripting approach.

 

Kind regards,
Bill

0 votes
Matteo Vecchiato
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2025

Suggest an answer

Log in or Sign up to answer