Have a custom field at epic level to track down time spent

We want to be able to track projects associated with a budget line. To model this, we have created a ‘budget’ field that corresponds to the budget line, and then we create Epics to represent the project, which is then broken down into Stories, Bugs, Tasks, and Sub-Tasks.

We track time spent at the level of Tasks, Bugs, and Sub-Tasks but not directly on Stories.

The ‘budget’ field is only filled on the Epic, we want to avoid to have to fill it on every child ticket.

We would like to be able to aggregate this time (estimation, remaining, and consumed) by budget line (our custom field ‘budget’) and then by project. Is this possible? Thank you in advance!

I have tried looking around this topic : JavaScript calculated custom fields

Based on this, I have tried to implement it this way :

[jira.customfield_budget]
name = "Epic Budget"
data_type = "string"
dimension = true
update_from_issue_key = "customfield_10700"
javascript_code = '''
if(issue.fields.customfield_11100 ) {
   issue.fields.customfield_budget = issue.fields.customfield_11100;
}
else{
issue.fields.customfield_budget = "Undefined Budget"
}

'''
multiple_values = true

Still no working
:frowning:

I have also tried to use the “Advance Seting” “Custom Field”


Trying it on a child ticket from the epic it does not “copy” the epic issue field to the current issue.

Trying it on the Epic issue, show a not null customfield_11100

I think I don’t understand how “update_from_issue_key” works. The documentation did not help.
I’ve also tried to inherit a simple text field from Epic to User Story without any success. Any clue?

Hi @dword ,
In your first configuration, you have added multiple_values = true; the inherited field dimension option is not supported for multiple-value fields. You can use this solution if your field is single-select.
Also, you should have to use update_from_issue_key = "epic_key" if you want to inherit your values from epic to its children.
The improved code that you need to add to eazyBI advanced settings would look like this:

[jira.customfield_budget]
name = "Epic Budget" 
data_type = "string"
dimension = true
update_from_issue_key = "epic_key"
javascript_code = '''
if(issue.fields.customfield_11100 ) {
   issue.fields.customfield_budget = issue.fields.customfield_11100;
}
else{
issue.fields.customfield_budget = "Undefined Budget"
}
'''

Whenever changing advanced settings for custom fields or issue links, you should perform double data import to ensure the correct outcome of changes (Advanced settings for custom fields).

You may do the following:

  1. In the import option, deselect the custom field “Epic Budget” from data import and import data. This action will clear the previous data and data structures.
  2. Wait for data import to complete.
  3. In the import option, select the custom field “Epic Budget” for data import and import data for the second time.

best,
Gerda // support@eazybi.com

Hi @gerda.grantina indeed it works. I missed the double data import I guess.

1 Like