New customfield as dimension: show component names matching special regex

Hi,

I want to create a new customfield called CVDS-ID as dimension.
I want to filter component names matching the regex [0-9_]{1,3}[A-Z]{2}[0-9]{3} only.

For e.g. an issue has a list of several components:
9_9EL080; CMC; CDP; eDX; CPS-3; XPC; 7ED070a; …

In the end I want to select the CVDS-IDs (9_9EL080 or 7ED070a) to see how many issues are linked.

CVDS-IDs

Who can help?

Many thx in advance

Hi @Helge,

Welcome to the eazyBI community.

You might define a new JavaScript-calculated customfield dimension to import only the components matching the proper mask.
Please read more about defining account-specific customfields here - Account specific calculated fields.

You could select the field to be imported as a string data type (1) and dimension (2)

The actual JavaScript code might be as follows.

var shortlist = [];
if (issue.fields.components){  
  for (var i=0; i< issue.fields.components.length;i++){
    var resulted = issue.fields.components[i].name.match("[0-9_]{1,3}[A-Z]{2}[0-9]{3}");
    if (resulted){
      shortlist.push(issue.fields.components[i].name);}
 }}
return shortlist.join(",");

Put relevant selections to allow import as multiple values (3) split by a comma (4).
After that - select that field for import as a dimension.

Regards,
Oskars / support@eazyBI.com