- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:26 AM
Hi All
I've been pretty good with my scripting within SN but I'm having an issue that I'm hoping someone can help with. Our Problem Manager asked for a PAIN value field to be added to our problem form, which is all good.
I'd like to write a script to calculate the PAIN value and populate the field to save some time and increase accuracy of the values for reporting. Below is the calculation to get this value:
(V x Y) x Z = PVC
V = Severity of each related Incident
- Severity 1 = 1000 points
- Severity 2 = 800 points
- Severity 3 = 500 points
Y = Number of related Incidents x V
Z = Total Outage Hours x Y
Has anyone done anything like this before?
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 08:02 AM
Your X and Y values ...
var severityArray = [];
severityArray["1"]=1000;
severityArray["2"]=800;
severityArray["2"]=500;
var X = severityArray[current.severity];
var count = new GlideAggregate('incident');
count.addEncodedQuery('parent='+current.sys_id);
count.addAggregate('COUNT');
count.query();
var Y = 0;
if (count.next())
Y = count.getAggregate('COUNT');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:44 AM
What will you say as related incidents? incidents by same caller ? or child incidents?
What is outage hours ? integer value or float ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 07:48 AM
Thanks for the quick response Kalai!
Sorry I mean child incidents, will update the question. Also outage hours would be an integer.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 08:00 AM
outage hours is a field on incident form ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2015 08:02 AM
I'm going to calculate the outage hours using the outage start and end fields that are currently on the Incident form