Calculating Jira Story Points based on fields at the Epic Level


We are using EazyBI with Jira and the epics contain user stories and bugs. We want to calculate the number of closed stories points during each time period categorized by a custom field at the epic level called “Work Type”. We assume that all stories and story points under that epic are of the same work type and to keep overhead low, we only populate this field at the epic level.

Based on research on these forums, an inherited JavaScript calculated custom field seems to be our best option. Does this code look correct? I’m not a developer, so I would appreciate the feedback.

name = “Work Type Inherited”
data_type = “string”
dimension = true
if (issue.fields.customfield_12345 ) {
update_from_issue_key = “epic_key”

Hi @adr-glz,

Yes, the code looks all right and should work. You may slightly improve the look of code by moving up the parameter update_from_issue_key leaving the JavaScript code the last parameter.

name = "Work Type Inherited"
data_type = "string"
dimension = true
update_from_issue_key = "epic_key"
if (issue.fields. customfield_12345) {
  issue.fields.customfield_wt_inherited = issue.fields.customfield_12345

Probably it is a coincidence the custom field ID is 12345. However, please check and use the custom field “Work Type” ID as it is in your Jira.
You can see the custom field ID also in eazyBI import options when hovering the cursor over the custom field name in the tab Custom field.

Zane /

Thank you Zane! The 12345 was just an example and we’ll use the actual field ID in our Jira project.