Create dimension based on labels of jira tickets

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