Forums

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

Automation - parent inherits status by its least progressed subtask

david_kubac October 4, 2023

I would like to set up an automation that checks the statuses of parent's subtasks and updates the parent task status accordingly. However, I don't need just a copy/paste of the status of one specific subtask but rather the status of the least progressed subtask.

Now I know that the Workflow varies by each organization and that it's not really linear, so within the automation, I need to specify based on which condition it should inherit the status.

Let's establish 4 different statuses:

  1. Backlog
  2. Todo
  3. In progress
  4. Done

The trigger most likely would be a subtask status change.

What happens next is the part I don't know how to do.

What I need to happen when any subtask changes its status is to validate all other subtasks to see, if I should trigger the parent change. Not only that, but I need to make it linear.

You can imagine something like:

  1. Are there any subtasks with status Backlog?
    1. if yes, set the parent status to Backlog and stop the automation
    2. if no, continue with the next condition
  2. Are there any subtasks with status Todo?
    1. if yes, set the parent status to Todo and stop the automation
    2. if no, continue with the next condition
  3. Are there any subtasks with status In Progress?
    1. if yes, set the parent status to In Progress and stop the automation
    2. if no, continue with the next condition
  4. Are there any subtasks with the status Done?
    1. if yes, set the parent status to Done and stop the automation
    2. if no, continue with the next condition

Any idea, how to achieve this?

1 answer

1 vote
Mark Segall
Community Champion
October 4, 2023

Hi @david_kubac 

Am I correct that you have a typo on 2.1, 3.1, and 4.1 that they should read "Todo", "In Progress", and "Done" respectively instead of "Backlog"?

If so, your rule could work like this:

  • TRIGGER: Issue Transitioned
  • CONDITION: Issue Type = Sub-Task
  • CONDITION (IF - JQL Any Match)
    • Parent = {{issue.parent}} AND status = Backlog
    • BRANCH (Parent)
      • CONDITION: Status != Backlog
      • ACTION: Transition Issue (To Backlog)
  • CONDITION (ELSE - JQL Any Match)
    • Parent = {{issue.parent}} AND status = Todo
    • BRANCH (Parent)
      • CONDITION: Status != ToDo
      • ACTION: Transition Issue (To Todo)
  • CONDITION (ELSE - JQL Any Match)
    • Parent = {{issue.parent}} AND status = "In Progress"
    • BRANCH (Parent)
      • CONDITION: Status != In Progress
      • ACTION: Transition Issue (To In Progress)
  • CONDITION (IF - JQL All Match)
    • Parent = {{issue.parent}} AND status = Done
    • BRANCH (Parent)
      • CONDITION: Status != Done
      • ACTION: Transition Issue (To Done)
david_kubac October 10, 2023

Thank you, I fixed the typo. Your solution looks sound! I will give it a go :)

david_kubac October 10, 2023

@Mark Segall I did a test and it doesn't work as expected, unfortunately.

What happens is that the parent inherits the subtask's status regardless of other subtasks.

As soon as I progress 1 subtask from Backlog to To do, the parent changes to To do.

What I need though is to keep the parent in Backlog until all subtasks are in To do.

See my video.

The expected result after the action I have done is that the Parent task will stay in status Backlog, instead, it transitions to To do.

Mark Segall
Community Champion
October 10, 2023

Ahh sorry about that.  I think we need to flip the script on this one:

  • TRIGGER: Issue Transitioned
  • CONDITION Issue Type = Sub-Task
  • ACTION: Lookup Issues
    • parent = {{issue.parent}}
  • IF CONDITION (Advanced)
    • {{lookupIssues.status.name}}
      Contains
      Backlog
    • BRANCH: (Parent)
      • CONDITION: Status != Backlog
      • ACTION: Transition Issue (To Backlog)
  • ELSE CONDITION (Advanced)
    • {{lookupIssues.status.name}}
      Contains
      ToDo
    • {{lookupIssues.status.name}}
      Does Not Contain
      Backlog
    • BRANCH: (Parent)
      • CONDITION: Status != ToDo
      • ACTION: Transition Issue (To ToDo)
  • ELSE CONDITION (Advanced)
    • {{lookupIssues.status.name}}
      Contains
      In Progress
    • {{lookupIssues.status.name}}
      Does Not Contain
      ToDo
    • BRANCH: (Parent)
      • CONDITION: Status != In Progress
      • ACTION: Transition Issue (To In Progress)
  • ELSE CONDITION (Advanced)
    • {{lookupIssues.status.name}}
      Contains
      Done
    • {{lookupIssues.status.name}}
      Does Not Contain
      In Progress
    • BRANCH: (Parent)
      • CONDITION: Status != Done
      • ACTION: Transition Issue (To Done)

I tested this in my test instance and it seemed to work.

Like abelalia87 likes this
Pavel Kovařík October 11, 2023

Hi @Mark Segall

could you also add a screenshot of this automation? Trying to replicate it but I dont see options "Contain, Does not contain" etc when I select IF block condition with advanced compare condition  

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.
October 11, 2023

Hi @Pavel Kovařík 

What version of Jira are you using: Cloud, Server, or Data Center?  And if using Jira Server, what version of automation rules do you have: Lite (free), or Pro (paid)?

The different versions of automation rules have different capabilities.  For example, the Advanced Compare Condition is not available for the Lite version of Jira Server automation rules.

Kind regards,
Bill

Mark Segall
Community Champion
October 13, 2023

Sorry for the delayed response.  If you're on cloud as this question is tagged, you should have the option.  Here's a snippet of the rule I created in my test environment:

2023-10-13_11-16-08.png

Suggest an answer

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

Atlassian Community Events