Skip to main content
Plan requirement: This feature requires an On-call Pro or higher subscription. Learn more

Use Cases

The system uses templates when assigning incidents in the following scenarios:
The system uses Golang template syntax to parse data, supporting logic, loops, pipelines, and common functions. For more functions, refer to sprig function library.
For security reasons, the following sprig functions are disabled. Using them in a template causes a function "xxx" not defined parse error:If you need a unique identifier inside a template, use incident variables such as {{.IncidentID}} or {{.LabelsMD5}}. If you need environment-specific values, pass them in via alert labels or field mappings instead of reading host environment variables from the template.

Configuring Templates

1

Create Custom Template

Go to Template Management page, click Create Custom Template or Copy Default Template
2

Edit Template Content

Edit content by notification channel, can reference fields from the variable list below
3

Save Template

Click Save to complete creation

Apply Template

1

Enter Escalation Rules

Go to ChannelEscalation Rules, click Edit
2

Select Template

In rule configuration, select which template to use for notifications
3

Save Configuration

Click Save to complete configuration. See Configure Escalation Rules

Variable Reference

Reference Examples

Incident Variables

Complete variable list for incident objects:

FAQ

  • Manually created incidents have no labels
  • Auto-created incidents have labels, same as the first merged alert’s labels
Go to Incident List → view incident details to see all label information.
When creating custom templates, the system uses mock data to check syntax. Mock data covers limited scenarios; rendering may fail at runtime, and system falls back to default template.
Recommend checking if variable exists before referencing:
Use toHtml function to handle:
Add $ before external variable:
Use index function:
Use jsonGet function to extract values by path from valid JSON. Syntax reference at gjson.dev.
imageSrcToURL: Convert image_key or URL to accessible address (for Dingtalk/Slack App)
transferImage: Upload image to third-party platform (for Feishu/Lark App)
Image size cannot exceed 10 MB, supports JPG, PNG, WEBP, GIF, BMP formats.

Channel Templates

Different notification channels support different template formats and limitations.
Requires Feishu/Lark integration configured first. Supports message card format; system auto-removes empty render lines caused by non-existent labels.Default Template (render all labels):
Feishu/Lark App Notification

Feishu/Lark App Notification Effect

Minimal Template (show key labels only):

Bot Templates

Template formats supported by group chat bots.
Supports message card, rich text, and plain text formats. Max message 4000 bytes, truncated if exceeded.

Other Channels

Default Template:

Configure Escalation Rules

Define incident notification rules and escalation mechanisms

Configure Personal Preferences

Customize notification time periods and channel preferences