Automation: Creating subtasks based on components

Maciej Smogorzewski May 23, 2021

Hi, 

Is there an option to prepare automation that allows me to create subtasks dependent on components (or other custom fields)?


Problem: 

I need to be able to prepare in the same time 2-6 clones of the same task/subtask based on a variable which allows me to assignee task to a direct team 


Example:

1. User creates a task 1
2. User chooses two components: Blue and Red. 
2. Automatically there should be created two sub-tasks (one for each component) 
3. Subtask 1 with component Blue
4. Subtask 2 with component Red
5. Title/Description are copied from a task 1

If I add more components there will be more sub-tasks automatically created. 


I would really appreciate Your help or ideas how I can set up sth like this. 

Best, 
M. 

2 answers

1 accepted

0 votes
Answer accepted
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.
May 24, 2021

Hi Maciej,

I would create an automation rule based on Issue Created trigger.

Then create a series of If / else block condition where it looks something like:

Use Issue Fields condition for the IF

If component = Blue

Then new action for Clone Issue with issue type of Sub-task

It would look like this:

screenshot.png

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.
May 24, 2021

HI @Maciej Smogorzewski 

Adding on to what @John Funk suggests... At this time, there is no concept of dynamic looping in automation for Jira.  That means that when you create a new component value, you would need to modify your rule to handle the new value.

Best regards,

Bill

Like # people like this
Maciej Smogorzewski May 31, 2021

@Bill Sheboy 

Ok, thanks a lot for information. Unfortunatley I will over 30 projects where I must have this flow. Tough case :) 

Maciej Smogorzewski May 31, 2021

@John Funk 

Thanks a lot! 

Like John Funk likes this
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.
May 31, 2021

You are welcome 😊

Maciej Smogorzewski June 1, 2021

@John Funk 

It works pretty well, so thanks again a lot - the only change I had to make was to switch "equals to contains". 

But now I'm facing another problem. Sub-tasks cannot be linked with epics, so
So when I clone a task (which has an epic) and then Jira converts it into a sub-task I'm receiving an error.  

Of course there is no problem with automation when I use it for tasks without an epic or when I made clones as tasks. 

Do You have any idea what I can force jira to ignore "epic" during creating sub-tasks? 

Best, 
Maciej 





Like John Funk likes this
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.
June 1, 2021

When you clone an issue in an automation rule, you may optionally set some of the fields.  Have you tried to clear the epic link as part of that action?

Like John Funk likes this
Maciej Smogorzewski June 2, 2021

@Bill Sheboy 

Yes, there are two options.

#1 To set Epic from a direct issue. I thought I could try to copy Epic from a task where Epic Link is Empty, but there is no option like this. 

Jira1z2.png

 

#2 There is also an option to use JSON. I tried it and it didn't work. BUT I'm sure if my command is correct. 


jira2z2.JPG


 

I tried sth like this (I added only the part with epic, the rest of it was already there)

{
"update": {
"labels": [
{
"add": "cloned"
}
],
"issuelinks": [
{
"add": {
"type": {
"name": "Cloners"
},
"fields": {
"Epic link": null
}

 

Regards, 
Maciej

Maciej Smogorzewski June 2, 2021

@Bill Sheboy  @John Funk 

Thank You again for Your help. 

I realized that my sub-tasks had the same screen scheme as tasks (where was Epic Link).
I associated sub-tasks with the different scheme without epic link and now it works perfectly.


Regards, 

Maciej 

Like # people like this
0 votes
Arto Kovalainen September 22, 2023

There is more simpler way to do this by using smart values. This creates subtask for each component chosen in the main task. In hour case 2 subtasks, Red and Blue
Screenshot 2023-09-22 at 14.59.10.png

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 22, 2023

Hi @Arto Kovalainen 

Thanks, and...Advanced branches, as you are showing, were added after this question was originally posted. 

As more features are added to automation rules I expect many questions' solutions / work-arounds will be superseded by newer approaches.

Kind regards,
Bill

Like Arto Kovalainen likes this

Suggest an answer

Log in or Sign up to answer