Performance Analytics - Issue with Breakdown mapping

Manoj Reddy Y
Tera Contributor

Hi Team,

 

I want to breakdown the result of an indicator which is on task_sla for category field which exist on sn_customerservice_case

 

I have created breakdown source with fact table sys_choice and field SysID with the filter as below

 

name=sn_customerservice_case^element=category^inactive=false^language=en

 

So i need breakdown mapping for task_sla table with the script as below ,but it's not working

 

var map_category_to_sys_choice = function(taskId) {
    try {
        if (taskId) {
			taskId = taskId.toString().trim();
            var taskGR = new GlideRecord('sn_customerservice_case');
			taskGR.addQuery("sys_id",taskId);
			taskGR.query();
            if (taskGR.next()) {
                var categoryValue = taskGR.getValue('category');
				gs.warn("Breakdown Mapping (Category): Finding value for "+taskGR.getTableName()+" with category value "+categoryValue);
				
                 if (categoryValue) {
                    var choiceGR = new GlideRecord('sys_choice');
                    choiceGR.addQuery('name', "sn_customerservice_case");                    
					choiceGR.addQuery('element', 'category');
                                        choiceGR.addQuery('value', categoryValue);
					choiceGR.addQuery("inactive",false);
					choiceGR.addQuery("language","en");
                                       choiceGR.query();
                                       if (choiceGR.next()) {
                                               return choiceGR.getUniqueValue();
					}
                }
            }
        }
        gs.error("Breakdown Mapping (Category): No valid match found for task ID (Category) " + taskId);
        return '';
    } catch (ex) {
        gs.error("Breakdown Mapping Script (Category) Error: " + ex.message);
        return '';
    }
};
map_category_to_sys_choice(current.task);

 

1 REPLY 1

jeffrubinoff
ServiceNow Employee
ServiceNow Employee

I see the breakdown source but what is the breakdown?