---
title: "Creating a Sum of Custom Field Values"
canonical: "https://support.appfire.com/space/SUPPORT/80878298/Creating%20a%20Sum%20of%20Custom%20Field%20Values"
format: markdown
---
Jira users often like to see the sum of time estimates (or other data) of child issues in the Epic.

## Strategy

The idea here is pretty simple. Add up all the values of the child custom fields and display it in an Epic. We can do so in three ways:

- Use the [SIL Script Custom Field](https://appfire.atlassian.net/wiki/spaces/KCF/pages/20906094). This requires the[ Power Custom Fields ](https://marketplace.atlassian.com/apps/1210749/power-custom-fields-for-jira?hosting=server&tab=overview)plugin.
- Use a SIL Listener.
- Use Live Fields as a listener.

Below are examples of each:

## SIL Script Custom Field

This is preferred way to keep a sum of other custom fields. 

|  |
| --- |
| ```
if (issueType == "Epic") {
    string jql = "\"Epic Link\" = " + key;
    string [] issues = selectIssues(jql);
 
    interval totalEstimateForEpic;
    for (string issue in issues) {
        totalEstimateForEpic += issue.estimate;
    }
 
    return totalEstimateForEpic;
}
``` |

## SIL Listener

Use a SIL Listener. To set up a SIL Listener, see this [documentation](https://appfire.atlassian.net/wiki/spaces/JJUPIN/pages/13240001). Your script would look something like:

|  |
| --- |
| ```
JFieldChange [] changes = lastIssueChanges(key);
 
if (changes[size(changes)-1].field == "estimate") {
    string epic = #{Epic Link};
    %epic%.estimate += #{Epic Link};
}
``` |

## Live Fields

Use [Live Fields](https://appfire.atlassian.net/wiki/spaces/JJUPIN/pages/13240209) as a listener. Your scrips would look something like the following. In the main script:

|  |
| --- |
| ```
lfWatch("estimate", "estimate", "hook.sil");
``` |

  
The hook script:

|  |
| --- |
| ```
string epic = #{Epic Link};
%epic%.estimate += argv["estimate"];
``` |

## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on this page. 

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |