Performance Analytics: data collector script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 09:13 AM
Trying to create an automated indicator to calculate the # of days after an incident has been breached.
I have the following configured:
1) Indicator Source (indicator source.jpg)
2) Automated Indicator (indicator.jpg)
3) Dashboard (dashboard.jpg)
I need help with the data collector script (see capture.jpg). I would like to calculate the # of days that have passed the breach time. I'm thinking the script would formulate the "breach time" (planned_end_time) minus from the current date/time (don't know how to create the variable for current system time). Can someone help me with the data collector script?
Much appreciated!
Thank you!
MIke
- Labels:
-
Dashboard
-
Performance Analytics
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 02:04 PM
You are using the incident SLA database view and did not use the prefix in your field name.
days(current.taskslatable_planned_end_time, score_end);
In your job log, you should have errors, to help you troubleshoot.
Maybe the UI Action set I have posted on ServiceNow Share earlier can help you.
Check the video starting at 2 min.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 03:29 PM
Arnoud,
Thank you. That worked. Is there a way to have breached time subtract from the current system time? I need help writing that into the data collector script.
Is this possible? What fields would I put in the automated indicator to represent the current time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 03:44 PM
You could try if following works
var dt = new GlideDateTime();
dt.getNumericValue();
But I recommend sticking to the score_end variable check Performance Analytics script variables
score_end is the end time of the date being (or another period) you are collecting. Always using the current DateTime gives wrong results, especially if you do a historic collection.
Please mark correct if the answer is so.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2017 03:59 PM
Perfect. Thanks for the recommendation. I'll stick with score_end. I'll try this when I get back to my computer and mark answer correct. Thank you!