Mapping Zephyr issues ID on EasyBI Cloud

Hello Community,

I am working to connect Zephyr Cloud to Easy BI.

I have used this documentation bellow to connect 3 Zephyr APIs, and now I need a help to map a few data from Zephyr.

This is a map:

I have the issueId information inside “links.issues” as image bellow, and I need adjust the data mapping from array to string.

The Zephyr API: Zephyr Scale for Jira Cloud API

I try used this documentation bellow to parse information using Advance options - Custom JavaScript code, but without success.

https://docs.eazybi.com/eazybi/data-import/external-data-sources/data-mapping

Could you help me?
Thanks in advance.

Hi @gerusalobo,

You can use JavaScript to modify the results for each column. The trickiest part is to iterate through all the linked issues (array) if there is more than one.

  1. First, click on column “links issues” and choose to Add calculated column (see the documentation for details: Data mapping)
    eazyBI will create a new column with the data type String that is suitable for mapping as a dimension.

  2. Now you add the JavaScript to the calculated column (see the documentation for details: Data mapping).
    The code that returns a separate list of linked issue IDs for the “links issues” column might look like this:

    //check if there is at least one link
    if (doc.links.issues.length) {
      var tissuelist = new Array();
      //iterate through individual links one by one
      for (var i = 0; i < doc.links.issues.length; i++) {
        var links = doc.links.issues[i];
        //from each link, get the issued
        tissuelist.push(doc.links.issues[i].issueId);
      }
      return issuelistzb.join(",");
    }
    

The data mapping for the “links issues” column might look like in the picture below.

Best,
Zane / support@eazyBI.com