SLA Policies
SLA policies define response and resolution time targets for tickets based on conditions and priority.
The SLA policy object
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Policy name (max 100 characters) |
description | string | null | Policy description (max 500 characters) |
isActive | boolean | Whether the policy is active |
timeMode | string | businessHours or calendarHours |
conditions | array | Matching conditions (see below) |
targets | object | Time targets by priority (see below) |
position | integer | Evaluation order |
createdAt | string | Creation time (ISO 8601 UTC) |
Conditions
[
{ "field": "priority", "operator": "is", "value": "urgent" },
{ "field": "tags", "operator": "contains_any", "value": ["vip"] }
]
| Field | Operators |
|---|---|
priority | is, is_not |
type | is, is_not |
status | is, is_not |
tags | contains_any |
assignee_id | is, is_not, is_set, is_not_set |
requester_domain | is, is_not |
customField:* | is, is_not, is_set, is_not_set, contains_any |
Targets
{
"firstReply": { "urgent": 30, "high": 60, "normal": 240, "low": 480 },
"nextReply": { "urgent": 30, "high": 120, "normal": 480, "low": 1440 },
"resolution": { "urgent": 240, "high": 480, "normal": 1440, "low": 2880 }
}
Values are in minutes (minimum 1).
List SLA policies
GET /helpdesk/api/sla-policies
Create an SLA policy
POST /helpdesk/api/sla-policies
Requires admin role.
Update an SLA policy
PUT /helpdesk/api/sla-policies/:policyId
Delete an SLA policy
DELETE /helpdesk/api/sla-policies/:policyId
Reorder policies
PUT /helpdesk/api/sla-policies/reorder
{ "orderedIds": ["sla_1", "sla_2", "sla_3"] }
Test a policy
POST /helpdesk/api/sla-policies/test
Test which policy would match a sample ticket.
Get SLA state for a ticket
GET /helpdesk/api/sla-policies/ticket/:ticketId
Returns the current SLA status, deadlines, and breach state for the ticket.
Recompute SLA
POST /helpdesk/api/sla-policies/recompute
Recalculates SLA for all open tickets based on current policy definitions.