Often you will want to sum values of a field to show a roll-up on an issue of these values. This might be something like Story Points, Time Logged, or other numeric values that are tracked in multiple tickets. You can sum up a custom field's values across multiple linked issues and display the total in a scripted field. Be aware that this type of field can face inconsistencies when attempting to search on the value. This section in the documentation gives an example of how you can handle reindexing for this type of script.