What This Table Is

The contract_sla table stores SLA definitions that control how ServiceNow measures and enforces service level agreements across ITSM processes. Each record defines breach times, warning thresholds, business calendars, and pause conditions that get applied when SLA workflows attach task_sla records to incidents, service requests, changes, and other task-based records.

Owned by the ITSM module, this table supports the complete SLA lifecycle from definition through breach notification. Each SLA definition can specify different duration targets for different conditions (priority, category, assignment group combinations) and controls whether SLAs pause when tasks are pending customer response or in other specified states.

The table extends sys_metadata and works as a configuration table — you rarely create records programmatically, instead querying existing SLA definitions to understand which apply to specific task conditions. Related tables include contract_sla_breakdown for condition-specific timing rules and task_sla for the runtime SLA instances that reference these definitions.

In large enterprises, expect 50-200 SLA definition records covering different service offerings, with each SLA definition potentially spawning thousands of task_sla instances daily. The table performs well for queries since record volume stays manageable, but watch for complex condition evaluations during SLA attachment workflows.

When You'll Script Against This Table

You'll query contract_sla most often in Business Rules that evaluate SLA applicability, Script Includes building SLA management utilities, and Scheduled Jobs generating SLA performance reports. Custom SLA attachment logic, SLA definition validation workflows, and integrations that need to understand service level commitments all hit this table regularly.

Users need sla_admin role for full CRUD operations, but most scripting contexts query with elevated privileges. The itil role provides read access for viewing SLA definitions and their associated breakdown rules.

  • Query active SLAs by table and condition to determine which apply to new tasks
  • Validate SLA configuration changes before deployment using automated checks
  • Build SLA selection logic in custom workflows that need to apply non-standard SLA rules
  • Generate reports showing SLA definitions and their configured breach/warning times
  • Sync SLA definitions with external service management tools during integrations
  • Clone or bulk-modify SLA definitions during service catalog or organizational changes
  • Audit SLA configuration compliance against corporate service level commitments

Table Gotchas

⚠️

The duration field stores time in seconds but displays in day/hour/minute format on forms. Always convert your calculations to seconds when comparing against duration values programmatically.

⚠️

SLA definitions with complex conditions in the condition field can cause performance issues during SLA attachment. Test condition evaluation performance with realistic task volumes before deploying complex conditional logic.

  • The active field doesn't prevent SLA attachment — inactive SLAs can still be manually attached to tasks through workflows or scripts
  • Business calendar changes don't automatically recalculate existing task_sla due times — only new SLA attachments use updated calendar settings
  • The collection field accepts table names but doesn't enforce referential integrity — you can reference non-existent tables without validation errors
⚠️

Pause conditions in the pause_condition field run against every task state change. Expensive queries or complex logic here can impact task update performance across your entire instance.

  • SLA workflows can create multiple task_sla records per contract_sla definition if conditions change during task lifecycle — one SLA definition can spawn multiple active SLA instances
Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime

The table extends sys_metadata, inheriting standard metadata fields and behaviors. Most directly related is contract_sla_breakdown, which stores the condition-specific timing rules that define different duration targets based on priority, category, or other task attributes. Each contract_sla record typically has multiple breakdown records defining escalation tiers.

You'll constantly join with task_sla when analyzing SLA performance, since task_sla records reference contract_sla definitions and store the runtime state (due dates, breach times, pause durations). The cmn_schedule table provides the business calendars that SLA calculations use, while sys_user_group and cmdb_ci_service often appear in SLA condition logic for group-based or service-specific SLA selection.

Since the collection field specifies which tables the SLA applies to, you'll frequently query alongside incident, sc_req_item, change_request, and other task-extended tables when building reports or validating SLA coverage across different ITSM processes.