Repair SLA via fix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 07:33 AM
I can't repair SLA using fix script. When I run it new SLA is not created. My script:
var gr = new GlideRecord("hr");
gr.get("3cd5888adb7190505f23d0a1ca96199e");
var repair = new SLARepair();
repair.repairByFilter(gr.getEncodedQuery(), gr.getRecordClassName());
SLA Definition:
Task:
The same when I click "Repair SLA". Can anyone help?
Regards,
Mikhail

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 07:36 AM
Be very careful when repairing SLAs and try to test in a sub-development environment if possible. There's a lot that can go wrong if not done properly, i.e. notifications shooting out, etc.
You can repair SLAs from the list view, I would recommend using the OOTB methods rather than trying to use a Fix Script.
Also ensure the property for using the Repair SLA workflow is turned on prior to attempting to repair, else it may try to use the original SLA workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2020 08:31 AM
Thank you,
I'm testing it in a development environment. We created "SLA definition" for hr table (task child) recently. Now I need to repair SLA for old hr records that have been closed before we created "SLA definition". So It doesn't work using the OOTB methods or a Fix Script but it works for new hr records, that have been created after we created "SLA definition". The property for using the Repair SLA workflow is turned on.
I think maybe something wrong with "SLA definition".
Regards,
Mikhail