Posting SLA repair on multiple incidents

Ballela Siva Te
Tera Contributor

Hi Team,

 

Is there a possibility to implement repair SLA on multiple incidents at once ? If so can you please let me know how can we do it

 

Regards,

Siva Teja B

1 ACCEPTED SOLUTION

Hi @Ballela Siva Te 

Yes You can, As mentioned in your old post -  You can multi select from list and click repair sla's button

or

If your ticket count is more then you can write a script and repair all incidents at once.

Refer below ServiceNow KB Article

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0720480

 

Try and let us know If it worked or not.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
4x ServiceNow MVP

View solution in original post

8 REPLIES 8

BrianS344076034
Tera Guru

Hello!
need some help with this as doing 100 at a time is going to be brutal

A previous manager created a custom SLA for first assignment... but didn't put a stop condition if the incident is cancelled.

so I have 78k records that this timer is running on, and i'd like to stop it.

 

If found the above to go and create the custom script, but not sure on some parts.


here is the script

var incidentQuery = "...paste encoded query here..."; 
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"); 

 

First part my encoded query, how do I find that
this is what I am looking at

Task SLA table
 SLA Definition Name contains CMC

Has Breached is True

Incident State is cancelled 

 

the SLA definition created is called CMC:Time to First Assigned To

 

Any help would be appreciated

Hi @BrianS344076034 

Navigate to 'task_sla' table and add your filter conditions 

 

Sample : Please modify accordingly

VoonaRohila_0-1769502918769.png

 

right click on the query and use 'copy query' to get the encoded query of the filter.

Sample query- "has_breached=true^sla.nameLIKECMC^task.ref_incident.incident_state=8" 

Use that encoded query in the script.

 

Note : Make sure you test this first in non-prod instance.

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
4x ServiceNow MVP

BrianS344076034
Tera Guru

Thanks @Voona Rohila 
for some reason I am not able to get the task > incident > incident state in my query, trying to get it added to the filter, but need to update the table assuming to pull that over

 

BUT then I noticed this at the bottom of the page

BrianSorensen_0-1769521930792.png

 

Yeah, As suggested above you can use either from list or from script.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
4x ServiceNow MVP