Getting a count of a specific issue type that has a combination of labels

Hi,

In this case, we would recommend using a Javascript code in eazyBI advanced settings to calculate a new issue field (during import) which you could import as a separate dimension, otherwise you will have to deal with complicated MDX code to calculate results as “Label” is a multi-value field and then report may become quite slow during calculation.

Try this code example:

[jira.customfield_sc]
name = "Scenario"
data_type = "string"
dimension = true
javascript_code = '''

var label1 = "Label 1";
var label2 = "Label A";
var label3 = "Label B";
var label4 = "Label 2";
var label = issue.fields.labels;

if(label){
  if (label.indexOf(label1) != -1 && 
     label.indexOf(label2) != -1)
    {     
      issue.fields.customfield_sc = "Scenario1";
    }
  if (label.indexOf(label1) != -1 && 
     label.indexOf(label3) != -1)
    {     
      issue.fields.customfield_sc = "Scenario2";
    }
  if (label.indexOf(label4) != -1 && 
     label.indexOf(label2) != -1)
    {     
      issue.fields.customfield_sc = "Scenario3";
    }
  if (label.indexOf(label4) != -1 && 
     label.indexOf(label3) != -1)
    {     
      issue.fields.customfield_sc = "Scenario4";
    }
};
''' 

Then you should be able to select the custom field in import options and later use as a filter in your reports.

Martins / eazyBI support

1 Like