Create dimension based on labels of jira tickets


#1

Hello,

I would like show reports with labels being rows and columns at the same time. As far as I know this is currently not possible in eazyBI.

Therefor I thought of creating own dimensions for different labels. Labels for different jira tickets are for example Location A, Location B and Location C. And I would like to have a dimension “Location” with these three Locations as members. Is there a possibility to do so?

Thank you very much in advance.

Best regards,
Fred


#2

Hi,

the solution is to create a custom calculated dimension using the Javascript.

The simplest way would be to fully reproduce the label dimension with the advanced settings like this:

[jira.customfield_labels1]
name = "Alternative labels"
data_type = "string"
dimension = true
multiple_values = true
split_by = ","
javascript_code='''
   issue.fields.customfield_labels1=issue.fields.labels.join(",");
'''

Now you should see the new custom field “Alternative labels” in the data import options and select to import it as a new dimension. After the data import, this dimension should behave the same way as the original label dimension.

You can write more advanced code for filtering some specific labels and create the dimension only by some of the labels. The Javascript code would be like this:

  var look_for=["LocationA"]; //list your selected labels here
  var result=new Array();
  for (i=0;i<issue.fields.labels.length;i++) {
    if (look_for.indexOf(issue.fields.labels[i])>=0) {
      result.push(issue.fields.labels[i]);
    }
  }
  issue.fields.customfield_labels1=result.join(",");

Note that after you change the advanced settings you need to do the full re-import of issues for the changes to take effect.

Kindly,
Janis, eazyBI support