An incident template is not the same as an incident type or an incident
form. Incident types categorize incidents; incident forms control which fields responders see
when declaring. An incident template maps alert data onto the incident that gets created.
Managing templates
Find your templates in Settings, alongside Alert Slack messages and Alert Teams messages. From here you can create, edit, and delete templates, and see which alert routes use each one. Editing a template applies to every route that references it, so a change to a shared template updates incident creation everywhere it’s used.The default template
Every organization has exactly one default template. It’s used whenever a more specific template isn’t set. You can’t delete the default, because you always need at least one template. To retire a template that’s currently the default, first set another template as the default, then delete it.Using a template in an alert route
When you configure incident creation on an alert route, you choose the template the route applies. There are two ways to set it:- Pick a template: apply the same template to every incident the route creates.
- Set it with an expression: choose the template per alert, for example by team or severity.
Older Terraform-managed alert routes may still have inline incident templates, which are deprecated. See Migrating
off inline templates.
Managing templates as code
Incident templates are available in the public API and the Terraform provider as theincident_incident_template resource.
Migrating off inline templates
Previously, incident templates were defined inline within an alert route’s configuration. Now that they’re standalone objects that routes reference, existing routes move off their inline template. What that takes depends on how you manage the route.Routes managed in the dashboard
Alert routes you manage in the dashboard are migrated for you. We create a shared template from each route’s inline configuration and repoint the route at it, with no change to the incidents the route declares. You don’t need to do anything. After migration your templates appear alongside your other templates, and your routes reference them.Routes managed with Terraform
Alert routes managed by Terraform keep their inline template and carry on working. To avoid forcing a migration, we don’t migrate them automatically, so you migrate these in your Terraform configuration when you’re ready. Runningterraform plan or terraform apply against a route that still has an inline template shows a deprecation warning linking here. The warning is a nudge, not a breaking change: inline templates on existing routes stay supported.
Migrating a route is a two-step change.
1
Create a standalone template
Move the route’s inline template into an
incident_incident_template resource. Keep the template block the same.2
Reference it from the route
Replace the route’s inline
incident_config.template with incident_config.incident_template, referencing the new
resource by ID.Before
The template is defined inline on the route:After
The template becomes its own resource, and the route references it:incident_incident_template resource, so its bindings resolve against the alert.
Run terraform plan and check it reports no change to how incidents are declared before applying.
A route that references a shared template can’t move back to an inline template. Setting both
incident_config.template and incident_config.incident_template on the same route is rejected.