create a predefine number of subtasks

Dd March 5, 2024

Is there a way in automation that upon a manual trigger, the automation will create 27 subtasks in a loop?

Basically I want to do the following:

Create a task called - MyTask

From it manually trigger an automation rule that will generate 27 subtasks named My-Task - Job X where X is increasing from 0 to 26.

So when completed, I will have:

Task: MyTask

  - Subtask: MyTask - Job 0

  - Subtask: MyTask - Job 1

  - Subtask: MyTask - Job 2

.

.

.

  - Subtask: MyTask - Job 26

 

2 answers

1 accepted

2 votes
Answer accepted
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.
March 5, 2024

Hi @Dd 

If you care about the subtask ordering, or each subtask has unique values, they will need to be added, one by one, as @John Funk suggests.

If you do not care about the ordering, they could be created with an advanced branch over the values.  The source of the values could be a created variable or a lookup table.

For example:

  • action: create variable
    • name: varJobList
    • smart value: Job 0, Job 1, Job 2
  • advanced branch:
    • name: varJob
    • smart value: {{varJobList.split(", ")}}
      • action: create subtask, referencing {{varJob}}

It is possible to even automate the creation of varJobList for your scenario, if you have a fixed number of issues to create.

If the number of issues is dynamic (e.g., from an issue field count) the solution is more complicated.  Here is a post describing a method to do that: https://community.atlassian.com/t5/Jira-Software-questions/how-to-use-jira-automation-to-create-multiple-issues-based-on-a/qaq-p/2443240

Kind regards,
Bill

Dd March 6, 2024

Is there a way to loop over all subtasks of a parent? 

I noticed that cloning will clone subtasks as well, so I can just generate one such task and then clone and loop over the "new" subtasks.

I couldn't find a smart value referring to a list of subtasks

Thanks

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.
March 6, 2024

For an issue, the smart value is:

{{issue.subtasks}}

That only contains some of the subtasks fields, such as link, summary, status, etc.  To access all of the fields, they would need to be branched to or loaded from a lookup issues action.

Like Dd likes this
1 vote
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 5, 2024

Hi Dd,

I don't know a way of creating the sub-tasks via loop. I think you will have to include a separate action for each one in the rule to create them.

Dd March 6, 2024

Sadly, it seems that this is the case (for now at least).

Thanks

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events