Forums

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

Create n number of subtasks using Jira cloud project automation

Vishal Biyani
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.
August 31, 2020

On Jira Cloud,

Using Project Automation, we can create predefined number of subtasks, when a issue tranistions from 1 state to another.

 

Is there way to create number of subtasks dynamically based on a value defined in any custom field?

 

2 answers

1 accepted

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 1, 2020

Hello @Vishal Biyani

Thank you for reaching out.

Unfortunately, Jira automation does not have a rule to use the number filled in a custom field to determine how many times an action should be triggered. We have the following feature request created to implement this possibility:

Ability to repeat/loop on a brach for a given number of times

For now, the best you can do to achieve your need would be by creating conditions for each number you set, creating the equivalent number of sub-tasks. This is a good approach if your team does not need to create more than 10 or 15 sub-tasks automatically:

Screen Shot 2020-09-01 at 16.17.53.png

Let us know if you have any questions.

Vishal Biyani
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 3, 2020

@Petter Gonçalves In continuation with this idea, i hit another road block

In order to update summary and description of sub-task, i created xml tags in Description field like below. i am not sure how to parse this.

Any way i can achieve this will be really helpful

<tag>

      <summary>Summary 1</summary>

      <description>This is description 1</summary>

</tag>

<tag>

      <summary>Summary 2</summary>

      <description>This is description 2</summary>

</tag>

Vishal Biyani
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 3, 2020

@Petter Gonçalves - You can ignore this. I have been able to implement this using chaining of smart values.

Like Petter Gonçalves likes this
Thuy Pham June 22, 2023

Hi Vishal,

I just came up with the exact same requirement like your post here: auto-create a defined number of subtasks based on their parent task custom field (number). I truly appreciate if you could share your approach using smart value.

Many thanks,

Thuy

1 vote
Vishal Biyani
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.
June 25, 2023

@Thuy Pham 

The solution that i came up with may not be optimal. However, it served the purpose.

Jira Automation does not allow looping like we do in programming. 

So assuming you want to create a predefined number of subtasks below can be done:

 

1. On an event trigger the rule. I used issue transition rule.

2. Populate variable using below rule

smartvalue.JPG

3. Then create the subtask, with summary and description like below

Summary: {{varCoding.split('~').get(0).substringBetween("<summary>", "</summary")}}

Description: {{varCoding.split('~').get(0).substringBetween("<description>", "</description")}}

 

Copying summary and description for n number of subtasks didn't make sense for my use case. if it works for you, then you can copy the summary and description from parent task as well.

Let me know if you have any question or suggestion.

Thuy Pham July 5, 2023

@Vishal Biyani

Thank you very much indeed. I am really sorry for answering after a long time.

I get to know of "Create variable" using smart value, which is so useful for my other problem, but unfortunately not this one.

As I have quite a lot number of subtask (sometimes up tp 60-100) so the approach of Petter Gonçalves is not best efficient. 

I came across this below solution:

https://community.atlassian.com/t5/Jira-Service-Management-articles/How-to-create-dynamic-looping-in-Automation-for-Jira/ba-p/2293077#M267

Frankly, it is far more complicated for me, I will need more time to consume the idea.

You might have a look if you want to leverage your current solution.

Best wishes

Thuy

Vishal Biyani
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.
July 6, 2023

@Thuy Pham 

Thanks for sharing the link. The idea looks interesting. 

Will explore sometime later and see how this approach can serve the purpose

Like Thuy Pham likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events