- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
This is a great question, and I do believe we can accomplish what you're asking for by adding another Breakdown to the same Indicator: Next Assignment Group. First, you'd need to make a new script that's similar to the one in step 2. Something like...
var nextAssignmentGroup = function(){
var returnMe = null;
// Query metric_instance for rows that have the same Document ID and
// Definition. Only look for the next most recent row that
// doesn't have the same value (Assignment Group name).
var assignments = new GlideRecord('metric_instance');
assignments.addQuery('definition',current.mi_definition);
assignments.addQuery('id',current.mi_id);
assignments.addQuery('value','!=',current.mi_value);
assignments.addQuery('start','>',current.mi_start);
assignments.orderBy('start');
assignments.setLimit(1);
assignments.query();
while(assignments.next()) {
// If we found a next assignment group,
// look up its sys_id and return that.
if(assignments.value != null){
var groups = new GlideRecord('sys_user_group');
groups.addQuery('name',assignments.value);
groups.query();
while(groups.next()) {
returnMe = groups.sys_id;
}
}
}
return returnMe;
};
nextAssignmentGroup();
This gives us the sys_id of the Assignment Group that the Incident was assigned to after the Service Desk.
You'll then need to repeat steps 3 and 4, but this time create a Next Assignment Group automated breakdown that maps to the script above.
Finally, you'll need to edit your Indicator, add the new Next Assignment Group breakdown, and run data collection for that breakdown.
I haven't tested this, so there might be bugs in the script you'll have to fix, but I'm pretty sure the theory is sound and that it will work. If you have any questions, or if you need clarification on any part of my suggestion, just let me know.
-Gray