Skip to main content

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​

WhereWhat the template doesLearn more
Routing rule conditionsDecide which destinations a notification goes to, for example alertDef.priority == "P1".Condition templating
PresetsBuild the message body, such as a Slack message, an email, or an HTTPS request body.Presets
Connector fieldsFill 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​

NamespaceAlertsCasesWhat it holdsReference
alertDef.*YesNoThe alert definition: name, priority, labels, type-specific configuration.Alert payload reference
alert.*YesNoThe alert event and its groups.Alert payload reference
case.*NoYesThe Case: title, status, priority, assignee, indicators, links.Case payload reference
caseMetadata.*NoYesWhy the Case notified now, and what changed.Case payload reference
_context.*YesYesThe envelope: entity type and subtype, routing labels, team, trigger.Global context
correlationKey, name, priorityYesYesFlat 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:

  1. Open a draft preset.

  2. Put this in the message body:

    {{ get_context() | json_encode(pretty=true) }}
  3. Read the preview.

Last updated on