Aggregate story points on stories under a epics grouped by a custom attribute

Jira report wanted:

Blue : 20 story points in sprint 1
Green: 25 story points in sprint 1

In jira: every Epic has a color (custom reporting field).
Epic A, color = blue, one story, 5 points.
Epic B, color = blue, 3 stories, 5 points each.
Epic C, color = green, 5 stories 5 points each.

I have been able so far to report on the individual Epics, showing their associated color and sum of story points. But I want to aggregate by the custom field itself, not epic by epic. Ideas?

Hi,

the solution for counting the issues by the values of the parent issue is described here:

The idea is that you need to create a Javascript calculated custom field in eazyBI inheriting the value down to the stories. Note that the exact Javascript code might depend on the type of custom field in Jira:

[jira.customfield_my_field_inherited]
name = "My field inherited"
dimension = true
data_type = "string"
update_from_issue_key = "epic_key"
javascript_code='''
if (issue.fields.customfield_NNNNN && issue.fields.customfield_NNNNN.value) {
  issue.fields.customfield_my_field_inherited=issue.fields.customfield_NNNNN.value;
}
'''

This example should work fine for the case if the color custom field is the single select (adjust the NNNNN with the custom field ID). After you import the “My field inherited” (you can adjust this name as you wish) it would create a new dimension where the value from epic is inherited down to all levels.

Kindly,
Janis eazyBI support

Thanks for the reply. I’ll look into this approach.

This worked beautifully.

One weird thing though: after I clicked the “import” button, the data was there–then the next day it was all gone!

I had to uncheck the boxes in the import settings, re-run the import; then RE-CHECK those boxes in the import and rerun the import. Then the data re-appeared. This is very mysterious. Known issue?

Thanks for the feedback, this observation is mysterious, indeed.
Please, report this behavior to the support if this effect persists (we might need additional details of how it can be reproduced).

Kindly,
Janis, eazyBI support

I have the same need. Should the same method work if I have my parent issue key in a calculated custom field instead of epic link field?

Is there also some kind of documentation available for this feature? I can’t fully understand what is happening here. What is for example “customfield_position_inherited”? I could not find this field explained in any documentation (I tried to search with Google).

Hi,

The “customfield_position_inherited” is the new ID of the custom field; this custom field is defined by the settings provided above. Once these settings are saved, the new “My field inherited” becomes available in the data import options:

Yes, you can use any other field in the update_from_issue_key parameter unless it contains the key of the “parent” issue. That setting tells eazyBI to inherit the custom field value from the parent. Note that you need to use the field ID here.

See here for more about eazyBI custom fields and the settings for them:
https://docs.eazybi.com/eazybijira/data-import/custom-fields/advanced-settings-for-custom-fields

Kindly,

Can’t make it work. Here is my try

[jira.customfield_track_inherited]
name = “Track from True Epic”
dimension = true
data_type = “string”
update_from_issue_key = “customfield_24778”
javascript_code=’’’
if (issue.fields.customfield_23872) {
issue.fields.customfield_position_inherited=issue.fields.customfield_23872.value;
}
‘’’

So this new custom field goes by id “customfield_track_inherited”. I manage to see it on the custom field list. I mark it to be imported, but all I see is (none) for every issue.

customfield_24778 has the key of the issue from which I want the value to be inherited.
customfield_23872 is the field that contains the value that should be inherited

What’s wrong?

Hi,

You are very close. You need to assign the value to the correct custom field in the last line of the code. You refer to the wrong ID “customfield_position_inherited”; you need to use the ID of the field in the settings header:

issue.fields.customfield_track_inherited=issue.fields.customfield_23872.value;

Please, check also that the “customfield_23872” itself is selected for import in the data import options, otherwise it might not appear in the JSON and the result will be empty.

Kindly,

I see. Note that you actually had the same in your own example above. The name of the custom field was different in the first row and in the if clause. That confused me.

But, still it does not work. Custom field 23872 is a calculated custom field. I wonder if this should work with calculated custom fields as well? To be specific, it’s a calculated text field implemented with Jira Misc Custom Fields.

Thanks a lot for pointing to this. I am very sorry about the wrong code provided; now it is updated accordingly.

The configuration with the scripted field would require a couple of more steps. Those fields are not included in eazyBI JSON by default and those fields store the values directly in the field, not in the structure with the “value” field.

  1. Add the following advanced options to tell eazyBI that the scripted field is of “recognizable” data type. You need to use the “string” if you wish to create a dimension from it.

    [jira.customfield_23872]
    data_type=“string”

  2. use the following code fragment to extract the value:

issue.fields.customfield_track_inherited=issue.fields.customfield_23872;

Kindly,

(By the way we solved this eventually, just a configuration thing.)