How sum up story point estimate in Epic from stories and others tasks?
Asked by Temur Khalilov:

I read almost all artictles about it.

Nothing helped![jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/228283i6EEED643D83B6EE2/image-size/large?v=v2&px=999 "jira.png")


Answers:
author: Bill Sheboy
body: Hi [@Temur Khalilov](/t5/user/viewprofilepage/user-id/3686963)

You are using a team-managed project so I assume you are using Jira Cloud.

When do you want to sum up these story and task values into the Epic? I assume it is when the value changes.

One challenge with this rule is that Story Point Estimate can only be edited in the rule using JSON. So your rule would be something like this:

* trigger: field value changes for Story Point Estimate
* condition: issue type is one of Story or Task
* action: lookup issues with JQL to find all related issues, replacing your project name
  * project = *yourProjectName* AND parent = {{triggerIssue.parent.key}}
* branch: on Epic (parent)
  * action: edit issue, using More Options, and JSON: <https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/>

```
{
  "fields": {
   "Story point estimate": {{lookupIssues.Story point estimate.sum|0}}
  }
}
```

Kind regards,  
Bill

comments: author: Temur Khalilov
body: Thank you very much, I did it, you are a very cool specialist. Thanks to the whole team.

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


author: Temur Khalilov
body: There is a problem with the JQL query, if I have 2 stories in the epic, when story points in one change, then the values ??of the last trigger are recorded in the epic

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


author: Temur Khalilov
body: How to find all related issues in Epic?


author: Temur Khalilov
body: I resolved!

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


author: Temur Khalilov
body: It doesnt work i dont know why

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


author: Temur Khalilov
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) can you help me ?


author: Bill Sheboy
body: What is not working as you expect?

For example...if there is an error in the audit log please provide that message. If instead the rule does not work as you expect, please describe the symptoms you observe versus what you expect.


author: Marina Shelestiuk
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) Hi!

I used this

* trigger: field value changes for Story Point Estimate
* condition: issue type is one of Story or Task
* action: lookup issues with JQL to find all related issues, replacing your project name
  * project = *yourProjectName* AND parent = {{triggerIssue.key}}
* branch: on Epic (parent)
  * action: edit issue, using More Options, and JSON: <https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/>

It almost worked. At least I've got "0" instead of nothing ;) Here are logs

![Screenshot_7.png](https://community.atlassian.com/t5/image/serverpage/image-id/237926iB464D6E6CECE0A66/image-size/large?v=v2&px=999 "Screenshot_7.png")I guess the problem is this - project = *yourProjectName* AND **parent = {{triggerIssue.key}}**

Do you have any ideas on how to improve it?

comments: author: Bill Sheboy
body: Hi [@Marina Shelestiuk](/t5/user/viewprofilepage/user-id/5122630) -- Welcome to the Atlassian Community!

My original post had a typo in the JQL, and should have been checking if parent = {{triggerIssue.parent.key}} when the trigger issue is a story (or task or bug).

Please try that to see how it helps. Thanks!

Kind regards,  
Bill


author: Marina Shelestiuk
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) It worked, thank you! Let's say its an automation rule# 1.

I also have automation rule# 2: When SP are added to subtask -\> then display the sum in a parent story. Here it is

![SP of story.png](https://community.atlassian.com/t5/image/serverpage/image-id/238132i3987F2892EFD7A63/image-size/large?v=v2&px=999 "SP of story.png")

The problem is that automation rule# 1 works fine if only I add SP to stories manually.

Otherwise, in case automation rule# 2 runs and shows SP of the story as a sum of SP of subtasks, automation rule# 1 ignores the value of the story SP. In logs, it shows as "No actions performed".

Is there any chance I can combine these two rules and make one, so SP could be calculated for a parent issue (epic and story)?

Or maybe there is a way to make automation rule# 1 make action when automation rule #2 runs?


author: Bill Sheboy
body: Hi [@Marina Shelestiuk](/t5/user/viewprofilepage/user-id/5122630)

I believe it is possible to create a rule to handle changes for either the subtasks or stories/tasks/bugs...and that approach is probably better than using two rules.

One way to do this is using if/else condition blocks, and then branch to the appropriate issues, as needed.

I recommend creating a test project and rule to experiment with this. And then your Jira Admin can copy the rule to the appropriate project when you have it all working.


author: Dan Tombs
body: Hi [@Temur Khalilov](/t5/user/viewprofilepage/user-id/3686963)

Not sure where abouts you got up to with the automation but we required something very similar and made this rule for rolling up worked time and time estimations. I am sure it could also be repurposed for story points.

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/228284i00C212952FFE23BE/image-size/large?v=v2&px=999 "Capture.PNG")![Capture1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/228285iC44C759F7625946C/image-size/large?v=v2&px=999 "Capture1.PNG")![Capture2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/228286i1CDFD00D9CB4D73B/image-size/large?v=v2&px=999 "Capture2.PNG")

This rule in regards to time is looking to see if any time is logged on the parent ticket (epic in your case). If there is, the it will go down the first branch where it will add the current time logged on the epic and then time logged on its chidren (tasks, stories etc.) If you use subtasks you will need to do this for this level as well.

In regards to summing up story points. This again you can do in a rule much the same. Using the sum smart values, you'll be able to add all story points together into a single field.

Hope this helps,

Dan

comments: author: Temur Khalilov
body: ??????, ???? ?? ????????? ???? ?????? ?? ???????, ? ?? ???? ??????????? story point estimate ?? ??????? ? ?????.

? ?????????? ????????? ???????, ?? ?? ??????????, ? ????????? ?????? ??????????? ????????.