SLARepair - Global
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API reference
The SLARepair script include provides methods that delete the existing SLAs and then recreates them from each task's history.
SLARepair - repairByFilter(String filter, String sourceTable)
Repair the task SLAs associated with the passed-in filter and source table.
Name | Type | Description |
---|---|---|
filter | String | Encoded query that is used to retrieve a set of records from the source table. |
sourceTable | String | Name of a table that is (or extends) contract_sla, task_sla, or task. |
Type | Description |
---|---|
void |
Example
Repair SLAs for problems created last month with a priority of 2.
SLARepair - repairByGlideRecord(GlideRecord now_GR)
Repair the task SLAs associated with the passed in GlideRecord.
Name | Type | Description |
---|---|---|
now_GR | GlideRecord | GlideRecord for a table that is (or extends) contract_sla, task_sla, or task. |
Type | Description |
---|---|
void |
Example
Repair SLAs for problems created last month with a priority of 2.
SLARepair - repairBySysId(String sysId, String sourceTable)
Repair the task SLAs associated with the passed in sys_id and source table.
Name | Type | Description |
---|---|---|
sysId | string | Specify the ID of a table that is (or extends) contract_sla, task_sla, or task. |
sourceTable | string | Specify the name of a table that is (or extends) contract_sla, task_sla, or task. |
Type | Description |
---|---|
void |
Example
Find problems created last month with a priority of 2.
SLARepair - setAuditEnabled(Boolean onOrOff)
Enables or disables auditing when running a repair.
By default, auditing is set to the value in the property com.snc.sla.repair.audit. You can override this by passing in true to enable or false to disable auditing.
Name | Type | Description |
---|---|---|
onOrOff | Boolean | Flag that indicates whether to enable auditing. Valid values:
|
Type | Description |
---|---|
this | Self-reference to allow for method chaining. |
Example
SLARepair - setRunWorkflow(Boolean onOrOff)
Enables or disables running a workflow for each of the Task SLA records being repaired.
By default, when a Task SLA is repaired the workflow is run during the repair process. To override this, you can pass in false to disable running of the workflow.
Name | Type | Description |
---|---|---|
onOrOff | Boolean | Flag that indicates whether to enable workflow. Valid values:
|
Type | Description |
---|---|
this | Self-reference to allow for method chaining. |
Example
SLARepair - setValidateOnly(Boolean onOrOff)
Validates the repair request.
If false is passed in, the task SLAs are repaired. If true is passed in, calls to repair don't alter any task SLAs, they only validate the supplied parameters and generate a count of records to be repaired.
Name | Type | Description |
---|---|---|
onOrOff | Boolean | Flag that indicates whether to enable validation. Valid values:
|
Type | Description |
---|---|
this | Self-reference to allow for method chaining. |
Example
On this page
- SLARepair - repairByFilter(String filter, String sourceTable)
- SLARepair - repairByGlideRecord(GlideRecord now_GR)
- SLARepair - repairBySysId(String sysId, String sourceTable)
- SLARepair - setAuditEnabled(Boolean onOrOff)
- SLARepair - setRunWorkflow(Boolean onOrOff)
- SLARepair - setValidateOnly(Boolean onOrOff)