Reviewing SLA Definitions
Find which SLA definitions breach, which overlap, and which never run. It reads the definitions and the attached task SLAs, and changes nothing.
Tables and roles
| Table | What it gives | Readable with |
|---|---|---|
contract_sla | Definitions: name, collection (the task table), type (SLA, OLA, Underpinning contract), target (response or resolution), duration, schedule, start/pause/stop conditions, active | itil can read the values, but on a Brazil instance it could filter only on name |
task_sla | One row per definition attached to a task: sla, task, stage, has_breached, business_percentage | itil |
When access is denied
- A 403 "Field(s) present in the query do not have permission to be read" on
contract_slameans the identity can read the definitions but not filter on that field. Read them all without a query and group them yourself. There are rarely more than a few hundred. - A 403 on
task_slameans breach rates are not assessable with this identity. aggregate_recordsrefused (401 under API-key auth, or 403): count fromlist_recordsrows instead.
Workflow
Progress checklist:
- [ ] Read every definition - [ ] Group them by table, target and type; flag overlaps - [ ] Count attached task SLAs and breaches per definition - [ ] Flag definitions that never attach - [ ] Recommend which to merge, retire or review
-
Read the definitions, with no query:
list_records(table_name="contract_sla", fields="sys_id,name,collection,type,target,duration,schedule,start_condition,stop_condition,pause_condition,active", limit=500)Page with
offsetuntil a page comes back empty. -
Group the active definitions by
collection,targetandtype. Within a group, compare start conditions:- Overlap: two definitions whose start conditions can both match the same task. Both attach, and the task is measured twice.
- Near-duplicates: the same conditions with different durations or schedules. They usually mean one replaced the other without being retired.
-
Breach counts per definition. Try the aggregate first:
aggregate_records(table_name="task_sla", group_by="sla,has_breached")If it is refused, read the rows and count them yourself:
list_records(table_name="task_sla", fields="sla,sla.name,has_breached,stage", limit=500)Page until empty. A definition's breach rate is breached rows over all rows that are not
cancelled. -
Definitions with no
task_slarows at all never attach. Their start condition may be impossible, or the process changed. -
Report:
- the overlapping groups;
- each definition with its row count and breach rate;
- the definitions that never attach;
- recommendations: merge overlaps, retire the unused, and look first at high breach rates on high-priority targets.
Recommend; don't change definitions.
Tips
business_percentageover 100 means the target was missed on the definition's schedule. Very large values usually mean an old task SLA that never stopped, so check itsstage.- OLAs and underpinning contracts measure internal teams and suppliers. Report them apart from customer-facing SLAs.
- The ServiceNow docs describe the definition fields and the task SLA stages; cite them in your report if the audience needs the background.


