Template variables
Every notification carries a payload: the data Notification Center renders your templates against. The payload depends on what sent the notification, an alert or a Case. This page shows where each part of the payload schema is documented, and where you can use it.
Where you use template variables
| Where | What the template does | Learn more |
|---|---|---|
| Routing rule conditions | Decide which destinations a notification goes to, for example alertDef.priority == "P1". | Condition templating |
| Presets | Build the message body, such as a Slack message, an email, or an HTTPS request body. | Presets |
| Connector fields | Fill templated connector fields, such as a Slack channel or an email recipient. | Connectors |
All three use the same variables and Tera syntax.
Payload schema by entity type
| Namespace | Alerts | Cases | What it holds | Reference |
|---|---|---|---|---|
alertDef.* | Yes | No | The alert definition: name, priority, labels, type-specific configuration. | Alert payload reference |
alert.* | Yes | No | The alert event and its groups. | Alert payload reference |
case.* | No | Yes | The Case: title, status, priority, assignee, indicators, links. | Case payload reference |
caseMetadata.* | No | Yes | Why the Case notified now, and what changed. | Case payload reference |
_context.* | Yes | Yes | The envelope: entity type and subtype, routing labels, team, trigger. | Global context |
correlationKey, name, priority | Yes | Yes | Flat shortcuts for deduplication keys and titles. | Each payload reference |
A router or preset that handles both entity types can rely only on _context.* and the top-level shortcuts. Reading alert.* in a Case notification, or case.* in an alert notification, fails the render. Branch on _context.entityType first.
Labels have different shapes in different namespaces. See Label data shapes.
Inspect a live payload
The references describe every field, but a given notification carries only the fields that apply to it. To see the exact payload for one alert or Case:
-
Open a draft preset.
-
Put this in the message body:
{{ get_context() | json_encode(pretty=true) }} -
Read the preview.