File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Core ServiceNow APIs/GlideAggregate/SLA Compliance Ratio by Assignment Group Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ var ga = new GlideAggregate ( 'task_sla' ) ;
3+ ga . addEncodedQuery ( 'task.sys_class_name=incident^active=false' ) ;
4+ ga . addAggregate ( 'COUNT' ) ; // All SLAs
5+ ga . addAggregate ( 'COUNT' , 'breach' , 'true' ) ; // breached SLAs
6+ ga . groupBy ( 'task.assignment_group' ) ;
7+ ga . query ( ) ;
8+
9+ gs . info ( 'SLA Compliance Ratio by Group' ) ;
10+
11+ while ( ga . next ( ) ) {
12+ var total = parseInt ( ga . getAggregate ( 'COUNT' ) ) ;
13+ var breached = parseInt ( ga . getAggregate ( 'COUNT' , 'breach' , 'true' ) ) ;
14+ var rate = breached ? ( ( breached / total ) * 100 ) . toFixed ( 2 ) : 0 ;
15+ gs . info ( ga . getDisplayValue ( 'task.assignment_group' ) + ': ' + rate + '% breached (' + breached + '/' + total + ')' ) ;
16+ }
17+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments