Creating an inherited field in eazyBI

Hello,

We have the following setup in eazyBI:

  • a customfield that will have the value B if the Initiative ticket has a label with value B, and the value A if the ticket doesn’t have it.
[jira.customfield_XLabels] 
name = "XLabels"
data_type = "string"
measure = true
limit = 1023
dimension = true
javascript_code='''

if (issue.fields.issuetype.name.equals("Initiative")) {

  issue.fields.customfield_XLabels = "A";
  if (issue.fields.labels){
    for (var i = 0; i < issue.fields.labels.length; i++){
      if (issue.fields.labels[i].indexOf("B") > -1 ){
            issue.fields.customfield_dataServicesLabels = "B";
            break;
      }
    }
  }

}

What we want is to create an inherited field based on the above customfield_XLabels field so we can have the value of that field from the Initiative to the Epic, Story and sub-task.
The Portfolio hierarchy is:
-Initiative
–Epic
—Story
----Sub-task

For the inherited field, this is what he have so far from reading the community answers, but it’s not working:

[jira.customfield_label_jpoh3]
name = "Initiative Label"
data_type = "string"
dimension = true
update_from_issue_key = "jpoh_parent_3"
javascript_code = '''
if(issue.fields.customfield_XLabels) {
   issue.fields.customfield_label_jpoh3 = issue.fields.customfield_XLabels;
}  

The expected value of the field customfield_label_jpoh3 would be to show the customfield_XLabels field value from the Initiative.
However, the customfield_label_jpoh3 only has the expected value when testing it on an Initiative issue, and no value for Epic, Story or sub-task.

Please provide support with adjusting the above customfield code. Thanks a lot.

Regards,
Greg

Hi @gvenablei,

You are very much on the right track. The thing is that eazyBI defines custom fields and executes the JavaScripts in the order you see the custom fields in the import selection, so - alphabetically. If one custom field depends on the other, you should take care that the “base field” is first. And you can do this by changing the names of the fields. So, for example, the name of the first field is XLabels and the second one would be XLabels of Initiative.

I realize that this could be done in a friendlier way specifying execution order. I added such an idea to the backlog.

I also see for the first field you have specified that the data_type is string. In such a case you do not need to add the two following settings:

measure = true
limit = 1023

Make sure to first unselect the fields from import and run the import without them to delete all previous configurations and then select them again.

Lauma / support@eazybi.com

Hi @lauma.cirule and thanks for the answer.
The actual name of the custom field is not XLabel, but another one: dataServicesLabel.
I also took out the settings mentioned.
I renamed the inherited field to “dataServicesLabel of Initiative”, unselected the fields, imported, selected them again, re-imported and still the inherited field is not showing any data for Epic, Story or subtask, only for Initiative.
Could you point me to where the issue might be in this case ? This field is required for executive reporting our company is using based on eazyBI.Thanks.

Regards,
Greg

Hi @gvenablei,

Could you please send the exact advanced settings you are using to support@eazybi.com? Put the link to this community request in the mail and note that you discussed this with Lauma.
I need to see the exact configuration to assist with debugging it.

Lauma / support@eazybi.com