TASK_SLA bulk repair script.

imran rasheed
Tera Contributor

I have a requirement to repair one common SLA in each of the incident ticket. I tried doing it in TASK SLA Repair option, but it updates the ticket work note with the wording "User experience SLA has been removed from 'Task' table" and it is updated with my name. But i want it as updated by the system. So i tried for a scheduled script. I found the below script, which runs and repair all the sla's in an incident. But i want only one particular SLA to be repaired and it has to be done by the system. Is it possible to do it. If so, kindly help me out.

var incidentQuery = "number=INC1553441^ORnumber=INC1551466^ORnumber=INC1541826";
var slaRepair = new SLARepair();
//slaRepair.setValidateOnly(true);
slaRepair.repairByFilter(incidentQuery, "incident");
if (slaRepair.validateOnly)
gs.log("SLARepair run in validate only mode - found " + slaRepair.taskIds.length + "
Incident records to repair", "SLARepair");

 

This script repairs all the SLA's in the incident. But i want only one common SLA to be repaired.

 

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi Imran,

 

I suggest you to use OOB Repair SLA itself. For making it not to be shown on the worknotes activity you can de-select below option.

Hi Jaspal,

 

I tried this option. But i don't want to implement in this way. I don't mind the work note getting updated. But i want it to be updated by the system.

In that case look for SLARepair script include that has all required funtions that make SLA repair work.

Hi Jaspal,

I just checked through the ui action. Couldn't understand much on it. Could you please help me out on this? 

Making changes in filter activity of work notes won't be  right because it might affect other relationship updates as well.