Forums

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

Count number of 'Defect-Task' under Parent and add to custom field 'Defect Count' to Parent

Richard Romero
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2023

We created a NEW subtask called 'defect-task' for our projects so users can now differentiate between a sub-task or defect-task under an issue.  However, we would like have a count under the parent of the number of defect-tasks.  Using automation, I was able to count the total number of subtasks under any given parent using {{issue.subtasks.size}} but the result also includes sub-task counts.  Defect Count Rule.JPG 

1 answer

0 votes
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 13, 2023

Hi @Richard Romero 

You can do that either using Lookup Issues with a JQL filter or with smart value, list filtering and a math operation.  Here are some references to help you try those methods:

Kind regards,
Bill

Richard Romero
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2023

Thanks Bill... Great resources but can you be more specific on how to resolve my particular problem with examples?

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

Certainly, and...using automation rules is often about experimentation and learning.  There really isn't anything in documentation that covers every scenario.

Let's try Lookup Issues...In your rule, it appears to be triggered on one of your Defect-tasks.  And so you could find all siblings with JQL such as this:

project = {{triggerIssue.project}} AND parent = {{triggerIssue.parent}} AND issueType = Defect-task

Using that with the Lookup Issues action would gather them, and then the count would be:

{{lookupIssues.size|0}}

I added a default value of 0 just in case there are none.

Suggest an answer

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

Atlassian Community Events