- 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-27-2015 07:52 AM
Great advice, thank you very much Robert!
