How to sumif estimates on specific sub-task types

Michael G_ November 29, 2022

I'm trying to sum numerical fields on sub-tasks at the parent level if the sub-task is of a particular sub-task type (we've setup new sub-task issue types).

I've managed to setup automation that sums up all sub-tasks regardless of sub-task type, but I need to be able to narrow it down further. Here's the snippet I use for the additional fields:

{
"fields": {
"Sum Back-end Estimates": {{issue.subtasks.Story Points.sum}}
}
}

 I want it to be more like

{
"fields": {
"Sum Back-end Estimates": {{issue.subtasks.Story Points.sumif(issue.subtasks.issueType.name,"Back-end Sub-Task")}}
}
}

2 answers

1 accepted

1 vote
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.
November 29, 2022

Hi @Michael G_ 

There are at least a couple of ways to do this:

  1. using JQL to find the subtasks you want (which have the trigger issue as parent), use the lookup issues action to gather and sum the values
  2. using an mathematical expression, an iterator on the subtasks, and conditional logic on the issueType, sum the values

I recommend trying the first one.

Kind regards,
Bill

Michael G_ November 29, 2022

Ah, using the look up action and then the corresponding {{lookupIssues}} resolved it. Thank you!

Like Bill Sheboy likes this
0 votes
Jamie Spatz January 19, 2023

I need a similar thing, Michael can you post a screenshot or text of the rule that you ended up writing for this? I'm not 100% clear on how one can use the lookup issues function here. 

Michael G_ January 19, 2023

the general flow goes:

  1. When Value changes for {field}
  2. Issue Type is one of {sub-task}
  3. For Parent
    1. Then: Lookup issues: issuetype = "Sub-Task" AND parent = {{triggerIssue.parent}}
    2. And: Edit issue fields
{
"fields": {
"Sum Estimates": {{lookupIssues.Story Points.sum}}
}
}
Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer