Performance Analytics Map assignment group in breakdown

ChAhmed
Tera Contributor

I am working on creating a PA report titled "Closed Tickets Per Day," using the assignment group as a breakdown field. The source field is task.assignment_group from the task_sla table. Since there are many assignment groups, I would like to summarize them under generalized names. This way, the chart will display fewer assignment groups, with their counts representing the sum of the actual values from the individual assignment groups.

 

Assignment GroupMapping
Helpdesk L1Helpdesk
Helpdesk L2Helpdesk
Desktop SupportHelpdesk
Network L1Network

 

I tried with the scripted breakdown but it still shows the actual groups in this custom breakdown Screenshot 2025-02-11 044118.png

function getMappedGroup(current) {
    var mapping = {
        "Helpdesk L1": "Helpdesk",
        "Helpdesk L1.5": "Helpdesk",
        "Desktop Support": "Helpdesk",
        "Network L1": "Network",
        "IT - EA": "Others",
        "IT - Engineering": "Others"
    };


    var groupName = current.assignment_group.getDisplayValue();


    if (mapping.hasOwnProperty(groupName)) {
        return mapping[groupName]; 
    }

    return "Unmapped"; 
}
getMappedGroup(current);

Please advise if there is any easy way to achieve the same I have more than 39 groups so just looking for a summarized breakdown without changing or adding the values to actual assignment groups

3 REPLIES 3

Tai Vu
Kilo Patron
Kilo Patron

Hi @ChAhmed 

Can you share the breakdown source that is currently associated with the scripted breakdown mapping from your screenshot?

To ensure that the mapping works correctly, we need to ensure that the returned values from your script align with the source data in the breakdown source.

 

Cheers,

Tai Vu

ChAhmed
Tera Contributor

Thanks for your feedback. Attached are the screenshots of the requested information.

Screenshot 2025-02-11 100934.png

 

Screenshot 2025-02-11 101155.png

 

Screenshot 2025-02-11 101226.png

 

Hi @ChAhmed 

Since your breakdown mapping is based on the assignment group, the breakdown source should be the Group [sys_user_group] table.

Recommended Approach:

Set up a parent-child relationship for assignment groups:

  • Define Helpdesk as the parent group of Helpdesk L1, Helpdesk L1.5, etc.
  • Then, in your scripted breakdown, simply return assignment_group.parent, and it should automatically map to Helpdesk or Network as expected.

Alternative Approach:

If your group data does not follow a parent-child structure, you can try this:

1. Use a Manual Breakdown to create a dataset where each generalized group (Helpdesk, Network, etc.) is explicitly defined.

TaiVu_0-1739427072672.png

 

2. Create a Breakdown Source using this manual breakdown data.

TaiVu_1-1739427078222.png

 

3. Modify your script to query the manual breakdown table and return the corresponding sys_id of the mapped group.

 

groupMapping(current.assignment_group.getDisplayValue());
function groupMapping(group){
	var mapping = {
		"Helpdesk L1": "Helpdesk",
		"Helpdesk L1.5": "Helpdesk",
		"DesktopSupport": "Helpdesk",
		"Network L1": "Network",
		"Network L1.5": "Network"
	};
	
	//Add these lines based on your script
	var grManualBreakdown = new GlideRecord('pa_manual_breakdowns');
	if(grManualBreakdown.get('value', mapping[group])){
		return grManualBreakdown.getUniqueValue();
	}
}

 

 

Enjoy!

TaiVu_2-1739427085066.png

 

Just keep in mind that the first approach is the recommended one.

 

Cheers,

Tai Vu