Mapping values (IDs) of a custom field to readable names

I work with the Jira plugin “AgileHive” that introduces a custom field to display additional information (the planned PI for a feature). When trying to import this field into eazyBI I noticed I only get the IDs, but not the value/real name.

Of course I want to show the human readable names instead of the IDs on my dashboards.

The easiest fix is to work with calculated members and define those manually like so:

 [Planning Interval].[PI 25.1] = [Planning Interval].[56]

 [Planning Interval].[PI 25.2] = [Planning Interval].[63]

However, this means I have to select individual members for each report separately, since there will be new values introduced regularly and all reports/dashboards have to be updated accordingly.

Optimally I would like to use the advanced import settings to do the mapping in one place and then be able to just use the “all members” selection in my reports.

Is there a way to use the additional advanced settings or custom javascript section to do a manual mapping right at the import stage?

I was not able to find the right place in the documentation on how to achieve this.

I imagine something like the following:

/* access the customfield somehow - I dont know how */
let customfield_1 = "??";

let mapped_value = 
    (customfield_1==56)?"PI 25.1":
    (customfield_1==63)?"PI 25.2":
    "unassigned";

return mapped_value;

Additionally, how strongly would such an operation impact the import times?

Hi,

Your approach for mapping the custom field codes to the readable names with the Javascript is a way to go. Although, it would also require regular maintenance of the code when new Planning intervals appear, it is quite efficient solution. Such a solution would not have significant impact on the data import runtime.

Kindly,
Janis, eazyBI support.

Hi Janis,

thank you for your answer! I am aware of the maintenance issue but I think it is the more reasonable approach to add the adaption in a single central place rather than updating multiple reports and dashboards periodically.

My main problem hasn’t been addressed yet - how do I access the custom field itself? In other words - what is the global variable context I am operating on when working inside the advanced settings javascript code window? (In a browser the equivalent would be the Window object where I know exactly what members I have access to). Could you kindly provide me some demo JS code how to do this or point me to the right place in the documentation?