I have a requirement to create SLA records for closed RITM's that never had an SLA at the time of closure
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 03:03 PM
I have a bunch of RITMs that were created and closed before we had RITM SLA's implemented. Is there a script that would go through each, generating the SLA record?
Here's a script i had partly put together from a similar reply here
var gr = new GlideRecord('sc_req_item');
var strQuery = 'active=false';
strQuery = strQuery + '^item=<item name>'; //catalog item name
gr.addEncodedQuery(strQuery);
gr.query();
while (gr.next()) {
var created = gr.sys_created_on;
var actual_end = gr.work_end;
var grSLA = new GlideRecord('task_sla');
grSLA.newRecord();
grSLA.task = gr.getUniqueValue();
grSLA.sla = '<sys_id>'; //sys ID of the SLA i'd like to run here
grSLA.schedule = '<sys_id>'; //sys ID of the schedule i'd like to run here
grSLA.start_time = created;
grSLA.end_time = actual_end;
grSLA.insert();
var task_sla = new GlideRecord('task_sla');
task_sla.get(grSLA.getUniqueValue());
SLACalculatorNG.calculateSLA(task_sla, false, task_sla.end_time);
}
Labels:
- Labels:
-
Service Level Management
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2022 09:08 PM