automation rule for subtask status change

Magdalena Migas July 7, 2020

Dear  Community, 

I would like to ask a question about status transition for subtask using Jira automation. 

if task = NEW - subtask = NEW
if task = TO DO or IN PROGRESS or PRETEST or TO TEST or DONE - subtask = TO DO
if task = BACKLOG - subtask = BACKLOG
if task = DELETED - subtask = DELETED

Is it doable in one rule or should i set up separate rule per condition ?

 

2 answers

1 accepted

1 vote
Answer accepted
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2020

i think you mean can it be one "rule" not "role"?

Assuming so I think you will want two rules if I'm understanding your situation.

  1. a rule for the task creation -- here I think you will create a sub-task when a task is created (?)
  2. a rule triggered by transition of a task -- here you will use an If/then condition: if task status = to do | in progress | pretest or ... then subtask status = to do....etc
Magdalena Migas July 8, 2020

Is  thats correct ? 

002523EF-AAC4-44D1-B6AA-053BB1B8F50C_4_5005_c.jpegE37776DF-90CE-4E2E-9F21-CD89F44693F3_4_5005_c.jpeg

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2020

No I don’t think so. I will come back to you here within the next couple of hours with a possible solution. I’m not where I can do this at the moment.

Magdalena Migas July 8, 2020

ok thank you ! ;)

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2020

Magdalena, sorry for the delay in getting back. It continues to be a busy day. So, I want to circle back to your requirement and ask a couple of clarifying questions before I give you what might be the proper automation solution.

I understand the notion of progressing the status of a sub-task based upon the parent tasks progression. However, I'm not clear when the sub-task(s) get created. That is, will a sub-task always be created when a task is created or only sometimes? If always, then I assume you wish to automate that too. If sometimes then I assume that will be done manually or are there reliable automate-able conditions that would allow you to automate the creation? With any automation it is important that you have really tight conditions to ensure the rule only executes when you really want it to otherwise you end up with a mess to clean up.

With that said, while I await your response, I do want to provide a bit more feedback on your screenshot above.

  1. I am assuming you want to update the sub-task every time the Task (parent) is transitioned or at least you want the rule to run with each Task transition. However, in your screenshot you are triggering on the sub-task creation. I may be understanding your goals here but if not. I would have one rule formed like this: When issue create, Condition = issue is Task (you may want more conditions to zero in on specific tasks), Action = Create sub-task and copy New status from parent
  2. You have a malformed condition under your branch in that you check if status = new AND if status = backlog. This logic would always fail since an issue can only have one status. Maybe you mean OR? Further you go on to another round of failed logic with the remaining statuses "and-ed".

ultimately I think you want the rule I mentioned in #1 and then a second rule that will look something like below but not exactly. Basically, if you want the sub-tasks to map to the exact same status as the parent then the below could be shortened to just have a branch and have the sub-tasks transition based upon the trigger (parent) issue. However, you have some unique mapping in your original post so you will want to use the if/else block like below and set the JQL on the If/Else, e.g. IF status in (TO DO, IN PROGRESS, PRETEST, TO TEST, DONE) THEN branch for sub-tasks and set status to TO DO,....

Project_automation_-_JIRA.jpg

Like Magdalena Migas likes this
Magdalena Migas July 9, 2020

Hi Jack, 

First of all thank you for the feedback and such a support regarding my question ! :)

As you mention above, yes my goal is exactly what you have concluded in first point #1.

Now as i understood correctly based on your query i should add if/else to set the proper conditions ?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2020

Yes. As you stated you have several scenarios for setting the sub-task status in your “if task = ...” statements so you will use the if/else to achieve the goals.

Magdalena Migas July 17, 2020

Hi Jack,

Unfortunately, I need to ask you for help again... with the automatization.

So, what I did actually is that i did copy your work and tried to apply in our projects. As a result, i made a massive mess with Sub-tasks statuses, because due to the "When issue transitioned" condition, our Sab-tasks have been changing statuses whenever the parent task did. The problem occurs when someone sets subtask for "done" and then the parent task was set for "To test" then Sub-task returned from "done" to "to do" again.
In this situation I have decided to change the condition from "when issue transition" to "when issue is created" but when I applied it, it doesn't work at all ;(

Please see the screenshots below:

 

442BD432-7296-475D-B2B9-FC000FC0CE57.jpeg698C1830-47C6-4EAC-BDD9-78D5E0AEDC17.jpeg

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 17, 2020

So to be clear it is very difficult to give you an exact solution w/o being in front of your instance as there is simply too many variables.

Some things to help you debug...

It appears you have two rules: issue created and issue transitioned, correct? Which rule is not succeeding? What do the automation logs convey? 

Is your initial status "Backlog"? If not then the "issue created automation" rule would never execute since it would fail the second Condition. Can you share an image of your Task workflow? Actually, now that I think about this, I don't see how this would work at all since the sub-tasks won't even exist at the time of Task creation. I think your rules need to look like below assuming that in fact you want sub-tasks added to every task that is created. If not then you need to have some unique conditions around the tasks that will have sub-tasks created.

Rule 1: Create sub-tasks

  • when issue created
  • condition - if Task
  • condition - if xxx (to zero in on tasks that should be actioned)
  • action - create sub-task(s) NOTE: if your initial status for both tasks and sub-tasks is "backlog" then this rule is all you need to create your sub-tasks and have them (and the parent task) in Backlog

Rule 2: Transition

I think the rule you have above is sound assuming it in fact reflects your goal of moving all sub-tasks to "to do" when the parent moves to "in progress".

1 vote
Canan ÇAPA February 4, 2023

Following rule worked for me. Hope this helps:

Ekran Alıntısı.PNG

Irem Tunalier February 22, 2024

Canan, greetings. Firstly, thank you for sharing. With some modifications, I'm currently able to run this automation in my own project. I just have one question. I've researched, but couldn't find an answer. Perhaps you have an idea.

Within tasks, there can be multiple subtasks. Currently, when the status of a subtask is updated, the main task is automatically updated as well. However, I want this to happen only once. In other words, I don't want the automation to keep setting the main task back to 'in progress' every time a subtask's status is updated. How can I add such control to this automation set?

Thank you very much in advance.

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