How to build automation to Sum a Field from linked EPICs into a Idea Custom Field (Numbers)?
Asked by Shaun Jeavons:

Hi everyone!

I'm looking to sum the number values from an Epic Field held in each linked Epic (Story Point Estimate) into my Idea's Custom Field (inventively called Linked Epic Story Point Total).

Does anyone know how to build an Automation Rule to achieve this?

I already have Automation Rules built into regular JIRA Cloud that achieve this e.g.

**For Stories** I join the Fields of Subtasks and the parent Story to sum the Story points:
> {  
> "fields": {  
> "Story point estimate": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}}
>
> }  
> }

**For Epics** I use a different method i.e. first I lookup Issues e.g.
> Lookup Issues: parent = "{{triggerIssue.parent.key}}"

Then for Parent I sum the total:
> {  
> "fields": {  
> "Story point estimate": {{lookupIssues.Story point estimate.sum}}  
> }  
> }

But despite tinkering with similar methods to link an 'Ideas' to its linked Epic, I can't make it 'read into these linked Epics' and then sum the "Story Point Estimate" values into that Idea's "Linked Epic Story Point Total" Field.

Has anyone else tried and succeeded with similar?


Answers:
author: Bill Sheboy
body: Hi [@Shaun Jeavons](/t5/user/viewprofilepage/user-id/1823324)

The approach to sum a field from Epics linked to an Idea is similar to your one to sum the values from the children of Epics to their parent. The differences include:

* Ideas link to their "delivery items" with a different link than the parent / child relationship. Try experimenting with issue searches in JQL to find the correct search expression needed for a lookup issues action.
* The rule will need to be global or multiple-project in scope to access issues outside of the JPD project. Please work with your Jira site admin to create such a rule as it will be defined in the global settings area for your Jira site.
* When and how frequently do you want the updates made?
  * For project scope rules like this, they are typically triggered on a change to a "child" issue for the rollup. If that is needed, a similar trigger could be used.
  * If less frequent updates are needed, a scheduled trigger rule could be used with JQL to iterate over the ideas
  * How many ideas and linked epics are involved? This is relevant as there are usage limits for automation rules; depending upon your license level, products, and user counts, such a rule on a large site could run often and use more capacity than anticipated. Again, please discuss this scenario with your Jira site admin to learn their thoughts.

Kind regards,  
Bill

comments: author: Curt Holley
body: I agree with [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) and can add that the linking between an Idea in JPD and an issue in Jira software is the ?mplements' link type.  
there are a number of them added/in use for JPD functionality, all easy to recognise (in the back-end/admin section) due to them all beginning with Polaris.  

<br />

![view Issue Link Types.png](https://community.atlassian.com/t5/image/serverpage/image-id/321201iDA6EEDA791109AB0/image-size/large?v=v2&px=999 "view Issue Link Types.png")


author: Shaun Jeavons
body: Thank you [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) ,

Sadly there is no admin / JIRA expert here - mainly me kicking the tires!

Currently the Automation Rule can look across both projects (i.e. the JPD project and JIRA project) and as per above I have solved rollup for subtasks rolling up to Issues and Issues rolling up to Epics within JIRA.

Do we know (seeing [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535) s comments below) if I need to have some polaris link type expression to roll up between JPD Idea and linked Epics?

Doesn't seem to use Epic Link between an Issue and a Idea.

Is this kind of rolling up of integer automation between JPD Ideas and JIRA Epics something you have been successful with?


author: Shaun Jeavons
body: Incidentally [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) there appears to be a distinct link between JPD ideas and 'Delivery progress' links (implements / implemented by as per [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535) ) vs. 'linked issues' (typical link types e.g. relates to).

It's the Delivery progress links I'm trying to join / roll up to which makes me believe that a regular parent/child relationship or 'linked issue' relationship doesn't exist between a RDP Idea and a JIRA issue.

Currently pretty clueless how to get eyes on what the correct advanced field expression should be!

Thank you again for your consideration


author: Bill Sheboy
body: As Curt showed, please try the "implements" link type. For example, the JQL could be this, substituting in your project:

project = *yourNonJPDProject* AND issueType = Epic AND issueLinkType = "implements"


author: Shaun Jeavons
body: Thank you [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) from that I can lookup Issues but the challenge now appears to be shifted to the Custom Field not being recognised / discarded.

Not certain will ever solve this. Thank you again for your guidance.

![2024-05-21 13_04_41-Audit log - Automation.png](https://community.atlassian.com/t5/image/serverpage/image-id/325011iDF4DDABA3787D7BB/image-size/large?v=v2&px=999 "2024-05-21 13_04_41-Audit log - Automation.png")


author: Shaun Jeavons
body: With correct lookup

Fieldtype is integer and it's rolling up from Story Points Estimate Field (also an integer)

![2024-05-21 13_10_35-Audit log - Automation.png](https://community.atlassian.com/t5/image/serverpage/image-id/325014i6CD7251CCECEA523/image-size/large?v=v2&px=999 "2024-05-21 13_10_35-Audit log - Automation.png")


author: Bill Sheboy
body: Are you trying to update a custom field named "Story Point Estimate RMP" or the built-in field for team-managed projects, "Story point estimate"?

Please post an image of your current, complete rule for context to go along with that audit log image? Also please include an image of the Edit Issue action.


author: Bill Sheboy
body: Moving post, as I added it in the wrong thread :\^)

comments: author: Shaun Jeavons
body: :)

Thank you again Bill

I am adding the 'Story Point Estimate RMP' field to the 'Idea' in Jira Discovery (RGMP) and am trying to roll-up scores from linked Issues and/or Epics that are linked via 'Is implemented by' from a Team-Managed Project (RG).

Generally I would prefer to link Epics to an idea.

The goal is to estimate the Epic in the RG Team-Managed Project by populating the standard 'Story point estimate' Field and have these estimates for all Epics roll up to the Idea ('implements').

Please forgive any light obfuscation!

![2024-05-21 17_37_23-Audit log.png](https://community.atlassian.com/t5/image/serverpage/image-id/325108i00B3823800890F7C/image-size/large?v=v2&px=999 "2024-05-21 17_37_23-Audit log.png")


author: Shaun Jeavons
body: Here's an example of an Automation that already works within the RG Project (only) that rolls up 'Story point estimate' values from the Issues, Bugs and Tasks to Parent Epics.

Have tried similar with RGMP Ideas but the parent child relationship doesn't seem to fit the Ideas \<\> linked Epics relationship

![2024-05-21 17_49_02-Rule builder - Automation - Jira.png](https://community.atlassian.com/t5/image/serverpage/image-id/325110i947D177E014A2519/image-size/large?v=v2&px=999 "2024-05-21 17_49_02-Rule builder - Automation - Jira.png")


author: Bill Sheboy
body: Thanks for that information, Shaun!

Your rule needs a few adjustments; the tricky parts of a rule like this are it is multiple-project and the links are *directional*. Here is an outline I believe will work:

* *the rule is multiple project in scope, declared at the global admin level*
* trigger: field value changes for Story point estimate
* condition: issue type does not equal Idea (There is apparently a built-in *Story point estimate* field in JPD projects, as they build on TMP, so let's constrain the rule to not process those.)
* lookup issues: to find the JPD idea linked to the trigger issue with this JQL
  * issue IN linkedIssues( {{triggerIssue.key}}, "implements" )
* smart value condition: let's check that only one Idea was found
  * first value: {{lookupIssues.size\|0}}
  * condition: equals
  * second value: 1
* lookup issues: now let's use that JPD idea to find the delivery issues implementing it with this JQL. I am assuming only one project's issues implement the Idea.
  * project = {{triggerIssue.project.key}} AND issue IN linkedIssues( {{lookupIssues.first.key}}, "is implemented by" )
* smart value condition: let's check some were found
  * first value: {{lookupIssues.size\|0}}
  * condition: greater than
  * second value: 0
* branch: linked issues of type "implements" to get the JPD idea (You could also save the key from the first Lookup Issues action and use a JQL branch.)
  * action: edit issue, using advanced edit with JSON to save the sum
    * {{lookupIssues.Story point estimate.sum\|0}}

If you compare this to your rule, the missing parts were to first find the Idea and then later to branch to it for updates. Please give a try and let me know what you find.