How to sum up the original estimate of all child issues to their parent issue.
Asked by Mohini Chandwani:

Need to add up all child issues original estimate to parent original estimate.

I have tried many ways join, sum, divide/60 even web request to get all child issues where original estimate is not empty but it is not performing sum returning empty expression.

Can refer the below snap for more clarity.

![original.png](https://community.atlassian.com/t5/image/serverpage/image-id/155610i85779D97B9260B04/image-dimensions/339x266?v=v2 "original.png")

Let me know for any workaround for this.

Thanks in advance.


Answers:
author: Rachael Harkin
body: Fantastic Tutorial on youtube here for this....no faffing, straight foward and very easy to follow.

[How to sum up story points from sub-tasks to parent issue using Jira automation - YouTube](https://www.youtube.com/watch?v=beeyNIHd5sY)


author: Darryl Lee
body: Ohey there's also a template for this in the library:

<https://www.atlassian.com/software/jira/automation-template-library#/rule/1371692>

comments: author: Bill Sheboy
body: Thanks, Darryl. I frequently forget that one for sub-tasks and end up "re-inventing the wheel" :\^)

__Bill


author: Bill Sheboy
body: Hi [@Mohini Chandwani](/t5/user/viewprofilepage/user-id/4260550)

You do not show in your rule what you are using to sum up the values, so would you please show that and show an image of your audit log from an execution that does not work as expected?

And you may want to look at these two posts, showing ways to do this for parent/children with and without sub-tasks involved:

* <https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115>
* <https://community.atlassian.com/t5/Jira-discussions/Atlympics-Automation-Calculate-the-sum-of-original-estimate-of/td-p/1767040>

Best regards,  
Bill

comments: author: Mohini Chandwani
body: Hello [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) ,

Rule is working fine, have referred the article which you have shared where I'm using advanced section for aggregation of all child's original estimate to parent.

![originalEstimate.png](https://community.atlassian.com/t5/image/serverpage/image-id/155873i657E7DD0AA66827C/image-dimensions/170x133?v=v2 "originalEstimate.png")

Just wanted to know if my parent issue is not an Epic type, so in that scenario what we are suppose to use. I have tried "For Parent" as branch option but it is not considering the parent and I guess it is only for subtask issues, can refer the below snap.

![branch.png](https://community.atlassian.com/t5/image/serverpage/image-id/155877iB66DD9E66C4C7240/image-dimensions/206x115?v=v2 "branch.png")

Can consider child issues are of "Bug,New Feature,Improvement,Task" type and parent is also one of them, do we have any branch to get the parent issue of all those child or with smart values can we find out.

Thanks for the help!!


author: Bill Sheboy
body: One thing to note is what type of project and what type of "parent" you have.

For company-managed projects, epics use the epic link to connect to child issues (story, task, bug). For team-managed projects, epics connect by parent. The branches should work for both. For story/task/bug to sub-tasks, that uses that type of parent/child relationship.


author: Mohini Chandwani
body: I have tried the other branch Linked issues with relationship of "Parent/Child", but it is not updating the parent issue.

![originalEstimateSum.png](https://community.atlassian.com/t5/image/serverpage/image-id/156603i7C83110DC859781C/image-dimensions/228x148?v=v2 "originalEstimateSum.png")

Let me know if I'm using incorrect way or wrong components.


author: pedro_pizarro_bip
body: Hi [@Mohini Chandwani](/t5/user/viewprofilepage/user-id/4260550) did u find the solution about ur last point?

I have the same problem.

Thanks


author: Mohini Chandwani
body: Hi [@pedro_pizarro_bip](/t5/user/viewprofilepage/user-id/4996220)

Yes, I have found the solution and implemented, it's working.

I'm attaching the snap of my rule, can refer.

Whenever the field value changes for Timetracking (Original estimate, time spent etc) the rule will get triggered, then triggered issue (child) will find the parent issue using the Linked issue branch component and will send the web request to get all child issues and their fields and at last adding of all original estimates of childs to parent through smart values.

And in Send web request, the following URL have been used.

[https://www.abcd.com/rest/api/2/search?jql=issuekey%20in%20linkedIssues(%22{{issue.key}}%22,%22is%20a%20Parent%20of%22,%22is%20blocked%20by%22)\&fields=timetracking](https://www.abcd.com/rest/api/2/search?jql=issuekey%20in%20linkedIssues(%22{{issue.key}}%22,%22is%20a%20Parent%20of%22,%22is%20blocked%20by%22)&fields=timetracking)

![OriginalEstimateSum.png](https://community.atlassian.com/t5/image/serverpage/image-id/209048i1AC1A787C6B21638/image-size/large?v=v2&px=999 "OriginalEstimateSum.png")

Can try and let me know it works or not.

Thanks.


author: pedro_pizarro_bip
body: Hi [@Mohini Chandwani](/t5/user/viewprofilepage/user-id/4260550) I'm trying but I see a different configuration in the part of "send web request"![send-web-request.GIF](https://community.atlassian.com/t5/image/serverpage/image-id/209071iC96DFDD6367BB364/image-size/large?v=v2&px=999 "send-web-request.GIF")

Do u have any idea about it?

Thanks


author: Mohini Chandwani
body: You have to use this below link

[https://www.abcd.com/rest/api/2/search?jql=issuekey%20in%20linkedIssues(%22{{issue.key}}%22,%22is%20a%20Parent%20of%22,%22is%20blocked%20by%22)\&fields=timetracking](https://www.abcd.com/rest/api/2/search?jql=issuekey%20in%20linkedIssues(%22{{issue.key}}%22,%22is%20a%20Parent%20of%22,%22is%20blocked%20by%22)&fields=timetracking)

![WebReq.png](https://community.atlassian.com/t5/image/serverpage/image-id/209087i299765056ECEE18D/image-size/large?v=v2&px=999 "WebReq.png")id:password encrypt it and use it.

And then add component Edit issue field where you can put for sum up the estimation in advance section, can refer previous screenshot.


author: Bill Sheboy
body: For a how-to article on calling a REST API from a rule, please see this one:

<https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>