Overriding Custom Field Values

What’s the best approach to overriding the values of a custom field in eazyBI?

In the below Weekly Hours Logged Report we have a custom field called Task Category that we will be hardcoding a mapping table in the calculated member but doesn’t appear to work. The red arrow points to the Task Category values we’d like to override.

Example: Calculated Member [Task Category].SAP Codes
CASE [Task Category].CurrentMember.Name
WHEN ‘Other’ THEN ‘Admin’
WHEN ‘User Assistance’ THEN ‘UA’
END

After digging around I scripted the below solution that solves this use-case.

Javascript added to Advanced Settings.

[jira.customfield_sapCode]
name = “SAP Code”
data_type = “string”
dimension = true
javascript_code = ‘’’
if (issue.fields.customfield_#### && issue.fields.issuetype.name == “Sub-task”) {
var sapCode = “Other”;

switch (issue.fields.customfield_####.value) {
case “Refinement”:
sapCode = “Requirements”;
break;
case “User Assistance”:
sapCode = “UX”;
break;
case “Coding”:
sapCode = “Code/Unit Test”;
break;
}
issue.fields.customfield_sapCode = sapCode;
}
‘’’

1 Like