What This Table Is
The task_sla table stores individual SLA tracking records that monitor service level agreement compliance for task records. Each record represents one SLA definition applied to one task, tracking breach percentage, pause state, duration calculations, and breach timestamps. The SLA engine automatically creates these records when tasks are inserted or updated based on SLA definition conditions.
This table is owned by the ITSM module and serves as the operational layer of ServiceNow's SLA framework. While contract_sla defines SLA rules and task_sla_controller manages pause/resume logic, task_sla records track the actual progress and breach calculations for each SLA instance.
The task_sla table does not extend any parent table — it's a standalone table with a reference to task records. No tables extend task_sla directly, though some scoped applications create custom SLA tracking tables that mirror this structure.
In large enterprises, this table grows rapidly — expect 500K+ records annually in high-volume environments. Each incident, request, change, or problem can generate multiple task_sla records if multiple SLA definitions apply. Performance degrades quickly without proper indexing on task, stage, and sla fields.
When You'll Script Against This Table
You'll typically script against task_sla in Business Rules on task tables (incident, request, change) to read SLA status for notifications or field updates. Script Includes and Scheduled Jobs query this table for SLA reporting and dashboard data. Background scripts commonly hit this table for data fixes or bulk SLA recalculations.
Access requires sla_admin role for full CRUD operations. The itil role provides read access for most SLA fields. Business Rules run with elevated privileges but client scripts respect user permissions.
Common scripting patterns:
- Query active SLA records by task reference to display breach status on forms
- Check
percentagefield values for escalation triggers (usually >80% or >100%) - Filter by
stagefield ('in_progress', 'paused', 'completed', 'cancelled') for workflow logic - Read
planned_end_timefor due date calculations and calendar integrations - Aggregate breach counts by assignment group or category for management reporting
- Update
business_pausefield for custom pause conditions (with extreme caution) - Join with
contract_slarecords to access SLA definition details and thresholds
Table Gotchas
Never directly insert, update, or delete task_sla records unless you fully understand SLA engine behavior. The SLA engine recalculates duration, percentage, and breach times based on schedule and pause logic — manual changes can create inconsistent data.
- The
percentagefield can exceed 100 — values >100 indicate breached SLAs, with 150 meaning 50% over the time limit - The
stagefield uses choice values, not integers: 'in_progress', 'paused', 'completed', 'cancelled' — string comparisons only
Duration calculations depend on schedule records (cmn_schedule). Querying duration without considering schedule gaps and business hours will produce incorrect SLA compliance calculations.
- Multiple SLA records can exist for the same task — filter by
active=trueto avoid counting historical or cancelled SLA instances - The
business_pausefield only affects future calculations — changing it doesn't retroactively adjust existing duration values
Querying task_sla without proper indexing kills performance. Always include task, stage, or sla reference fields in your queries. Avoid queries filtering solely on percentage or duration — these fields aren't indexed.
Enjoying this? Get one deep-dive per week.
Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.
Related Tables
The task table is the primary relationship — each task_sla record references one task record via the task field. You'll frequently join these tables to display SLA status on incident, request, change, or problem forms. The contract_sla table defines the SLA rules that generate task_sla tracking records.
The task_sla_controller table manages pause/resume conditions and links to task_sla records. Developers query both tables together when building custom pause logic or debugging SLA timing issues. The cmn_schedule table provides business hours calculations referenced by SLA duration logic.
You'll also work with sys_user and sys_user_group tables when building SLA reports grouped by assignee or assignment group. The cmdb_ci table becomes relevant for SLA reporting by affected configuration items or services.