Jira Automation for budget/cost sum per epic
Asked by Jennifer Weber:

We added a numeric field to our issues in which we put the cost of this specific task. It should be added to the budget of the linked epic when it is updated.

Can anyone share ideas how we could implement this?


Answers:
author: Stefan Salzl
body: Hi [@Jennifer Weber](/t5/user/viewprofilepage/user-id/5435315)

welcome to the community.

So just to clarify that I got it correctly:

Whenever one of the child issues' codt field of an epic is updated the costs of all children should be summed and the sum should be written into same field in the epic?

Could you confirm that?

Best  
Stefan

comments: author: Jennifer Weber
body: Hi [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993) - yes exactly this is what we would like to do!

If using different fields or sth like that would make it easier we are flexible on that.


author: Stefan Salzl
body: Alright. I would suggest the following way:

Trigger:

* when
  * field value of your "cost" field changes
  * condition: only start when the changed field?s issue has a parent/EPIC
* then:
  * collect all children of that epic (via lookupIssue)
* branch:
  * to Epic
  * within the epic (as you then are in the context of the epic) edit field "budget"
    * fill in sum of lookupIssues? field "cost" via smart value
    *

      ```
      {{lookupIssues.cost.sum}}
      ```

See screenshot below (in my case I used the field "Number 1" in both child task and Epic).

Hope this is helpful. In case of any further questions just let us know.

Best  
Stefan

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310117iC52EE101987E8C7C/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310118i15926CD2E535D49E/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310119i299C8FAD4CC75F54/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310120iB887CC1402A97EAB/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310121i515ED771F2929285/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/310122iA394DCED5CCFBAAB/image-size/large?v=v2&px=999 "image.png")


author: Jennifer Weber
body: Thanks a lot! The automation does work but somehow it does not find any issues in the lookup-step, although there should be several. What could be wrong here?

=\> No issues were found when searching for a user-defined value.

![2024-03-05 09_51_57-Audit log - Automation - CMK-DIM - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/310218iF9A6F0B4CF479B7D/image-size/large?v=v2&px=999 "2024-03-05 09_51_57-Audit log - Automation - CMK-DIM - Jira.png")


author: Jennifer Weber
body: Just found the solution here =\> <https://support.atlassian.com/jira-service-management-cloud/docs/jql-fields/#Epic-link>

![2024-03-05 10_06_20-JQL fields _ Jira Service Management Cloud _ Atlassian Support.png](https://community.atlassian.com/t5/image/serverpage/image-id/310226i2932D9CCD19452C8/image-size/large?v=v2&px=999 "2024-03-05 10_06_20-JQL fields _ Jira Service Management Cloud _ Atlassian Support.png")

If I use "parent" instead of "epic link" it works perfectly. Thank you [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993)


author: Stefan Salzl
body: Nachdem dein Screenshot auf Deutsch ist k?nnen wir vermutlich auch in unserer Muttersprache kommunizieren :)

Freut mich sehr zu h?ren dass es funktioniert hat und dass ich helfen konnte.

LG  
Stefan


Tags: automation

cloud

jira-work-management-cloud