Can we sum up "number" fields of all child issues and update parent's ?? (Not task/subtask)
Asked by testJira seb:

Hi,

I am on DC (not cloud) and unable to find out automation rule about sum in the case

Can we sum up "number" fields of all child issues and update parent's ?? (Not task and subtask, but with ParentLink and childLink)

<br />

<br />

Remember  
- child A have number field = 12  
- child B have number field = 10  
- Parent issue (with parentlink, not task/subtask) = 22 (first time it is correct)  
- This is fine so far but  
- A : 12 -\> 15 (updated)  
- Parent Issue = 37 (not 25 like it should)

the problem is solved if we use tasks and subtasks = a solution exists

BUT

tasks and subtasks being limited to a single level (you cannot create several nested subtasks). As a result, it is possible, for a tree structure of this type, to use the principle of Parentlink/Childlink ; and therefore no more limit to a single sub-level but as many as desired

I've seen all of these answers (about "sum" pbl), which work great for task and subtask cases.  
On the other hand, it is impossible to run a procedure correctly with the ParentLink / childlink. For these cases, we fall into the same process.  
Do you have a solution for this type of case?

Thanks all.


Answers:
author: Bill Sheboy
body: Hi [@testJira seb](/t5/user/viewprofilepage/user-id/4865148) -- Welcome to the Atlassian Community!

Just to confirm, are you noting that you have an automation rule and it works once and then produces incorrect results on later executions?

If so, please post an image of your complete rule, including the details of the field action, and the audit log details showing both a first and later execution run. That information may provide context for the community to offer suggestions. Thanks!

Kind regards,  
Bill

comments: author: testJira seb
body: Hi Bill,

automation rule works but results are incorrect.

here is example = we don't use "task/subtask" but "parent link". so we use "issue IN parentIssuesOf( {{issue.key}} )" to get parent ... But after that, how to get info about childs ?

with task/subtask, we use "subtasks" keyword (for example, to "sum" infos)

keyword with parent and childs ?


author: testJira seb
body: ![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/192330iC1E8F777F450985C/image-size/large?v=v2&px=999 "Capture.PNG")


author: testJira seb
body: try "childIssues" but No.

other one ? ;-)


author: Bill Sheboy
body: If "parent link" is the field linking your issues, try using a Lookup Issues action to gather the sibling issues of the trigger issue with this JQL:

"Parent Link" = {{triggerIssue.Parent link"}}

You may then sum your field using the lookup results, for example:

{{lookupIssues.*myCustomFieldName*.sum}}


author: Stefan Salzl
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) lookupIssues is only available on cloud. It?s DC in this case =S


author: Bill Sheboy
body: Thanks, Stefan; I missed that!

Unfortunately Lookup Issues and nested branches are not supported yet, so the work-arounds are limited: entity properties and a scheduled rule with bulk-processing that includes a branch to the parent.


author: Stefan Salzl
body: Hi [@testJira seb](/t5/user/viewprofilepage/user-id/4865148) and welcome to the community,

did a quick research and found a feature request for that. You can upvote for it here:

<https://jira.atlassian.com/browse/JIRAAUTOSERVER-135>

As I got your requirement and the above mentioned feature request right it's not possible yet.

Best  
Stefan

comments: author: testJira seb
body: Hi Stefan, yes <https://jira.atlassian.com/browse/JIRAAUTOSERVER-135> is the same way.

we can go to parent with

```
issue in parentIssuesOf("{{issue.key}}") 
```

but how to get informations about all childs ?


author: B?reng?re PERES
body: Dear community,

Have we finally found out how to designate all the child issues of a given Parent issue in that use case?


author: Stefan Salzl
body: Hi [@B?reng?re PERES](/t5/user/viewprofilepage/user-id/4338710)

How exactly does your hierarchy define parent and child? Are you using advanced roadmaps?

What does your use case look like that needs to be solved?

Best  
Stefan


author: B?reng?re PERES
body: Thank you [@Stefan Salzl](/t5/user/viewprofilepage/user-id/5074064)

I have exactly the same use case than TestJira Seb's one : In Jira DC, I have an issue types hierarchy corresponding to Advanced Roadmaps hierarchy settings. My Parent and Child issue types are linked by the field Parent link. I am able in my automation rule to refer to the the parent issue to be updated but i cannot find out how to refer to my number fields in child issues that must be summed.

Regards,

BP


Tags: data-center

hierarchy

sum