The SLA plugin enforces build-time validation rules where field requirements depend on other field values:
Duration Type Validations:
durationType is empty (user specified duration): duration is mandatory, and schedule is mandatory
when scheduleSource is "sla_definition". The conditions.pause, conditions.resume, and whenTo.resume fields are allowed.durationType is a relative duration: duration, conditions.pause, conditions.resume, and whenTo.resume are restricted (warning).
Values from existing SLA definitions will be preserved but cannot be modified.Schedule Source Validations:
scheduleSource is "no_schedule": schedule, timezoneSource, timezone, and scheduleSourceField are restricted (warning).
The schedule field is automatically set to a default value.scheduleSource is "task_field": schedule and duration are restricted (warning), and scheduleSourceField is mandatory.scheduleSource is "sla_definition" (default): schedule is mandatory.Retroactive Start Validations:
retroactive.start is false or not set: retroactive.setStartTo and retroactive.pause are restricted (warning).retroactive.start is true: retroactive.setStartTo is mandatory, and retroactive.pause is allowed.retroactive.start is true AND durationType is a relative duration: retroactive.pause is restricted (warning).Condition Field Validations:
timezoneSource is "sla.timezone": the timezone field is allowed. Otherwise, it is restricted (warning).whenTo.resume is "no_match": conditions.resume is restricted (warning).whenTo.cancel is not "on_condition": conditions.cancel is restricted (warning).// Basic SLA with user specified duration
Sla({
$id: Now.ID['incident-priority-1-sla'],
name: 'Priority 1 Incident Response',
table: 'incident',
duration: Duration({ hours: 4 }),
schedule: 'schedule-sys-id',
conditions: {
start: 'priority=1',
stop: 'state=6',
},
})
// SLA with relative duration
Sla({
$id: Now.ID['incident-relative-sla'],
name: 'Relative Duration SLA',
table: 'incident',
durationType: 'relative-duration-sys-id',
schedule: 'schedule-sys-id',
// Note: duration, conditions.pause, conditions.resume, whenTo.resume are restricted
})
Creates an SLA definition with conditional field requirements.