Reporting on Average Age of Incidents & other Task Types
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 06:33 AM
Hello,
I am very new to Performance Analytics and have been using a few OOTB packs that come with the tool to tailor my reporting to the teams I support.
I have encountered an Issue whereby I am unable to get the Average Age of Open Incidents.
My current method is to have 3 Indicators setup and use a formula to calculate the average.
1: Sum of Open Incidents
Source: Incidents assigned to xyz Assignment Groups
Aggregate: Sum
Field: Active
Additional conditions: State not in (Resolved, Closed)
Table: Incident
2: Summed age of Open Incidents
Source: Incidents assigned to xyz Assignment Groups
Aggregate: Sum
Script: var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);};
hours(current.opened_at, score_end);
Additional conditions: Active = true .and. State not in (Resolved, Closed)
Table: Incident
3) Average Age of Open Incidents
Formula: [[Summed age of Open Incidents]]/[[Sum of Open Incidents]]/24
All of these indicators are linked to a historic job I ran which came up with the error:
Error during JavaScript evaluation: Not all references of "current" are passed in by "arguments" script: var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);};
hours(current.opened_at, score_end);
When I check the Widget, no data is displayed. I took the script from the OOTB "HRCase.Open.Age.Hours" which I assumed could be copied to anywhere and yield the same results. However, evidently this is not the case. I was hoping for some guidance on where I may be going wrong. I also have little to no experience with JavaScript so not really able to translate the error.
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 08:56 AM
Hi Declan,
Have you already looked at these OOTB PA widgets? Do these fulfill the requirements you are looking for?
I can see there is one existing OOTB indicator you can use as a replacement for your second indicator - Summed age of open incidents screenshots below -
(Link - https://InstanceName.service-now.com/pa_indicators.do?sys_id=fd5a3e02d7130100b96d45a3ce6103aa)
Let me know if the above does not help, we can check further.
Thanks
-Harneet Sital (ServiceNow Certified Technical Architect)
Request you to please mark my answer as helpful or correct based on the impact
Find all my ServiceNow articles here