Documentation Index Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt
Use this file to discover all available pages before exploring further.
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:
Scenario Description Manual incident creation Manually create and assign incident Auto-generated incident Report alert event, system auto-generates incident, assigns per matched escalation rule Reassignment After incident creation, manually change assignment Escalation Based on escalation rule settings, system auto-escalates assignment Reopen assignment After incident closed and reopened, reassigns per previous settings
For security reasons, the following sprig functions are disabled. Using them in a template causes a function "xxx" not defined parse error: Category Disabled functions Environment env, expandenvNetwork lookup getHostByNameCryptography bcrypt, htpasswd, derivePassword, encryptAES, decryptAESCertificate generation genPrivateKey, buildCustomCert, genCA, genCAWithKey, genSelfSignedCert, genSelfSignedCertWithKey, genSignedCert, genSignedCertWithKeyRandomness randBytes, uuidv4, randAlphaNum, randAlpha, randAscii, randNumeric, randInt, shuffleError raising fail
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
Create Custom Template
Go to Template Management page, click Create Custom Template or Copy Default Template
Edit Template Content
Edit content by notification channel, can reference fields from the variable list below
Save Template
Click Save to complete creation
Apply Template
Enter Escalation Rules
Go to Channel → Escalation Rules , click Edit
Select Template
In rule configuration, select which template to use for notifications
Variable Reference
Reference Examples
// Reference incident title
{{. Title }}
// Reference creator name
{{. Creator . PersonName }}
// Reference resource label value
{{. Labels . resource }}
// Reference label with "." (e.g., "A.B")
{{ index . Labels "A.B" }}
Incident Variables
Complete variable list for incident objects:
Field Type Required Description ID string ✓ Incident ID Titlestring ✓ Incident title Descriptionstring ✓ Incident description, may be empty DetailUrl string ✓ Incident detail page URL Num string ✓ Incident short identifier, for visual recognition only IncidentSeveritystring ✓ Severity: Critical / Warning / Info IncidentStatus string ✓ Incident status: Critical / Warning / Info / Ok Progressstring ✓ Processing progress: Triggered / Processing / Closed StartTimeint64 ✓ Trigger time, Unix timestamp in seconds LastTime int64 Latest event time, Unix timestamp in seconds EndTime int64 Recovery time, Unix timestamp in seconds SnoozedBefore int64 Snooze end time, Unix timestamp in seconds AckTime int64 First acknowledgment time, Unix timestamp in seconds CloseTime int64 Close time, Unix timestamp in seconds Creator Person Creator info, doesn’t exist for auto-generated Closer Person Closer info, doesn’t exist for auto-recovered AssignedTo Assignment Assignment configuration Responders []Responder Responders list ChannelID int64 Channel ID ChannelName string Channel name GroupMethod string Grouping method: n (none) / p (rule-based) / i (intelligent) Labelsmap Label KV, both Key and Value are strings AlertCnt int64 ✓ Associated alert count Alerts []Alert Associated alert details FireType string Notification type: fire (notify) / refire (loop notify) IsFlapping bool Whether in flapping state Impact string Incident impact, filled after closure RootCause string Incident root cause, filled after closure Resolution string Resolution, filled after closure
Field Type Required Description person_id int64 ✓ Person ID person_name string ✓ Person name email string ✓ Email address
Assignment - Assignment Configuration
Field Type Required Description PersonIDs []int64 Person ID list, only exists when assigned by person EscalateRuleID string Escalation rule ID EscalateRuleName string Escalation rule name LayerIdx int Assignment level, starts from 0 Type string ✓ Assignment type: assign / reassign / escalate / reopen
Field Type Required Description PersonID int64 ✓ Person ID PersonName string ✓ Person name Email string ✓ Email address AssignedAt int64 ✓ Assignment time, Unix timestamp in seconds AcknowledgedAt int64 Acknowledgment time, Unix timestamp in seconds
Field Type Required Description Title string ✓ Alert title Description string ✓ Alert description, may be empty AlertSeverity string ✓ Severity: Critical / Warning / Info AlertStatus string ✓ Alert status: Critical / Warning / Info / Ok StartTime int64 ✓ Trigger time, Unix timestamp in seconds LastTime int64 Latest event time, Unix timestamp in seconds EndTime int64 Recovery time, Unix timestamp in seconds Labels map Label KV
FAQ
How do I know what Labels are available?
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.
Configured custom template but default template was used instead?
Incident title has character escaping (like >)?
Use toHtml function to handle: // Escape HTML characters
{{ toHtml . Title }}
// Render with first non-empty value
{{ toHtml . Title . TitleEnglish }}
How to convert time format?
How to reference external variable inside for loop?
Add $ before external variable: {{ range . Responders }}
{{ if eq $. Progress "Triggered" }}
【 Pending 】{{. Email }}
{{ end }}
{{ end }}
How to extract field value with . (like obj.instance)?
How to extract labels from associated alerts and deduplicate?
// alertLabels: Get deduplicated array
{{ alertLabels . "resource" }}
// joinAlertLabels: Deduplicate and join with delimiter as string
{{ joinAlertLabels . "resource" ", " }}
How to iterate and print Labels?
// Complete iteration
{{ range $ k , $ v := . Labels }}
{{$ k }} : {{ toHtml $ v }}
{{ end }}
// Exclude single label
{{ range $ k , $ v := . Labels }}
{{ if ne $ k "resource" }}
{{$ k }} : {{ toHtml $ v }}
{{ end }}
{{ end }}
// Exclude multiple labels
{{ range $ k , $ v := . Labels }}
{{ if not ( in $ k "resource" "body_text" )}}
{{$ k }} : {{ toHtml $ v }}
{{ end }}
{{ end }}
How to extract info from JSON field?
imageSrcToURL : Convert image_key or URL to accessible address (for Dingtalk/Slack App){{ $ root := . }}
{{ range $ i , $ v := . Images }}
{{ $ imageURL := imageSrcToURL $ root $ v . Src }}
{{ if $ imageURL }} ! []({{$ imageURL }}){{ end }}
{{ end }}
transferImage : Upload image to third-party platform (for Feishu/Lark App){{ $ root := . }}
{{ range $ i , $ v := . Images }}
{{ $ transferURL := transferImage $ root $ v . Src }}
{{ if $ transferURL }} ! []({{$ transferURL }}){{ end }}
{{ end }}
Image size cannot exceed 10 MB, supports JPG, PNG, WEBP, GIF, BMP formats.
How to use logical operations?
Function Description Example andLogical AND {{if and (eq .A "x") (eq .B "y")}}orLogical OR {{if or (eq .A "x") (eq .A "y")}}notLogical NOT {{if not (eq .A "x")}}eqEqual {{if eq .A "x"}}neNot equal {{if ne .A "x"}}gt / geGreater than / Greater or equal {{if gt .AlertCnt 1}}lt / leLess than / Less or equal {{if lt .AlertCnt 10}}
How to find more functions?
Channel Templates
Different notification channels support different template formats and limitations.
Feishu/Lark App
Dingtalk App
WeCom App
Slack App
Microsoft Teams
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):{{ if . Labels . body_text }}{{. Labels . body_text }}{{ else if . Description }}{{. Description }}{{ end }}
{{ if . Labels . resource }} ** resource ** : {{( joinAlertLabels . "resource" ", " )}}{{ end }}
{{ range $ k , $ v := . Labels }}
{{ if not ( in $ k "resource" "body_text" "body_text_with_table" )}} ** {{$ k }} ** : {{$ v }}{{ end }}{{ end }}
{{ $ root := . }}
{{ range $ i , $ v := . Images }}
{{ $ transferURL := transferImage $ root $ v . Src }}
{{ if $ transferURL }} ! []({{$ transferURL }}){{ end }}
{{ end }}
Minimal Template (show key labels only):{{ if ( index . Labels "resource" )}} resource :{{ toHtml ( joinAlertLabels . "resource" ", " )}}{{ end }}
{{ if ( index . Labels "check" )}} check :{{ toHtml ( index . Labels "check" )}}{{ end }}
{{ if ( index . Labels "metric" )}} metric :{{ index . Labels "metric" }}{{ end }}
{{ if ( index . Labels "trigger_value" )}} trigger_value :{{ index . Labels "trigger_value" }}{{ end }}
{{ if ( index . Labels "region" )}} region :{{ index . Labels "region" }}{{ end }}
{{ if ( index . Labels "cluster" )}} cluster :{{ index . Labels "cluster" }}{{ end }}
{{ if ( index . Labels "service" )}} service :{{ index . Labels "service" }}{{ end }}
{{ if ( index . Labels "env" )}} env :{{ index . Labels "env" }}{{ end }}
Requires Dingtalk integration configured first. Supports message card format; system auto-removes empty render lines. Default Template :{{ if . Description }} ** description ** :{{ toHtml . Labels . body_text . Description }}{{ end }}
{{ if . Labels . resource }} ** resource ** : {{ toHtml ( joinAlertLabels . "resource" ", " )}}{{ end }}
{{ range $ k , $ v := . Labels }}
{{ if not ( in $ k "resource" "body_text" )}} ** {{$ k }} ** : {{ toHtml $ v }}{{ end }}{{ end }}
{{ $ root := . }}
{{ range $ i , $ v := . Images }}
{{ $ imageURL := imageSrcToURL $ root $ v . Src }}
{{ if $ imageURL }} ! []({{$ imageURL }}){{ end }}{{ end }}
Requires WeCom integration configured first. Supports message card format. WeCom limits card length, template render area max 8 lines , excess will be hidden.
Default Template :{{ if ( index . Labels "resource" )}} resource :{{ toHtml ( joinAlertLabels . "resource" ", " )}}{{ end }}
{{ if ( index . Labels "metric" )}} metric :{{ index . Labels "metric" }}{{ end }}
{{ if ( index . Labels "trigger_value" )}} trigger_value :{{ index . Labels "trigger_value" }}{{ end }}
{{ if ( index . Labels "region" )}} region :{{ index . Labels "region" }}{{ end }}
{{ if ( index . Labels "cluster" )}} cluster :{{ index . Labels "cluster" }}{{ end }}
{{ if ( index . Labels "service" )}} service :{{ index . Labels "service" }}{{ end }}
{{ if ( index . Labels "env" )}} env :{{ index . Labels "env" }}{{ end }}
Requires Slack integration configured first. Max message length ~15000 characters, truncated if exceeded. When displaying images, separate images from other content with ---, format starts with 
{{ end }}
{{ end }}
Requires Teams integration configured first. Max message ~28KB, errors if exceeded. Default Template :{{ if . Description }} ** description ** :{{ toHtml . Labels . body_text . Description }}{{ end }}
{{ if . Labels . resource }} ** resource ** : {{ toHtml ( joinAlertLabels . "resource" ", " )}}{{ end }}
{{ range $ k , $ v := . Labels }}
{{ if not ( in $ k "resource" "body_text" "body_text_with_table" )}} ** {{$ k }} ** : {{ toHtml $ v }}{{ end }}{{ end }}
Bot Templates
Template formats supported by group chat bots.
Feishu/Lark Bot
Dingtalk Bot
WeCom Bot
Slack Bot
Telegram Bot
Supports message card, rich text, and plain text formats. Max message 4000 bytes, truncated if exceeded.
Message Card (msg_type: interactive)
{
"msg_type" : "interactive" ,
"card" : {
"config" : {
"wide_screen_mode" : true ,
"enable_forward" : true
},
"header" : {
"template" : "{{if eq .IncidentSeverity \" Critical \" }}red{{else if eq .IncidentSeverity \" Warning \" }}orange{{else}}yellow{{end}}" ,
"title" : {
"content" : "{{fireReason .}}INC #{{.Num}} {{toHtml .Title}}" ,
"tag" : "plain_text"
}
},
"elements" : [{
"tag" : "div" ,
"fields" : [{
"text" : {
"tag" : "lark_md" ,
"content" : "**🏢 Channel:**{{.ChannelName}}"
}
},
{
"text" : {
"tag" : "lark_md" ,
"content" : "**⏰ Trigger Time:**{{date \" 2006-01-02 15:04:05 \" .StartTime}}"
}
}]
},
{
"tag" : "action" ,
"actions" : [{
"tag" : "button" ,
"text" : { "tag" : "plain_text" , "content" : "Details" },
"type" : "primary" ,
"url" : "{{.DetailUrl}}"
},
{
"tag" : "button" ,
"text" : { "tag" : "plain_text" , "content" : "Acknowledge" },
"type" : "primary" ,
"url" : "{{.DetailUrl}}?ack=1"
}]
}]
}
}
Rich Text (msg_type: post)
{
"msg_type" : "post" ,
"post" : {
"zh_cn" : {
"title" : "{{if eq .IncidentSeverity \" Critical \" }}🔴{{else if eq .IncidentSeverity \" Warning \" }}⚠️{{else}}ℹ️{{end}} {{fireReason .}}INC #{{.Num}} {{toHtml .Title}}" ,
"content" : [
[{ "tag" : "text" , "text" : "🏢 " }, { "tag" : "text" , "text" : "Channel: " , "style" : [ "bold" ]}, { "tag" : "text" , "text" : "{{.ChannelName}}" }],
[{ "tag" : "text" , "text" : "⏰ " }, { "tag" : "text" , "text" : "Trigger Time: " , "style" : [ "bold" ]}, { "tag" : "text" , "text" : "{{date \" 2006-01-02 15:04:05 \" .StartTime}}" }],
[{ "tag" : "a" , "href" : "{{.DetailUrl}}" , "text" : "Details" }, { "tag" : "text" , "text" : " " }, { "tag" : "a" , "href" : "{{.DetailUrl}}?ack=1" , "text" : "Acknowledge" }]
]
}
}
}
{{ fireReason .}} INC #{{. Num }} {{ toHtml . Title }}
-----
Channel : {{ if . ChannelName }}{{. ChannelName }}{{ else }} None {{ end }}
Severity : {{. IncidentSeverity }}
Trigger Time : {{ date "2006-01-02 15:04:05" . StartTime }}
Duration : {{ ago . StartTime }}
< br /> Details : {{. DetailUrl }}
Only supports Markdown messages (syntax limitations ). Max message 4000 bytes. If text contains <br />, empty lines are removed first during rendering, then replaced with newlines.
Default Template :{{ fireReason .}} INC [#{{. Num }}]({{. DetailUrl }}) {{ toHtml . Title }}
---
- Channel : {{ if . ChannelName }}{{. ChannelName }}{{ else }} None {{ end }}
- Severity : {{$ s := colorSeverity . IncidentSeverity }}{{ toHtml $ s }}
- Trigger Time : {{ date "2006-01-02 15:04:05" . StartTime }}
- Duration : {{ ago . StartTime }}{{ if gt . AlertCnt 1 }}
- Grouped Alerts : {{. AlertCnt }}{{ end }}{{ if . Labels . resource }}
- Resource : {{ toHtml ( joinAlertLabels . "resource" ", " )}}{{ end }}
---
< br /> [ Details ]({{. DetailUrl }}) | [ Acknowledge ]({{. DetailUrl }}? ack = 1 )
Only supports Markdown messages (syntax limitations ). Max message 4000 bytes. Default Template :{{ fireReason .}} ** INC [#{{. Num }}]({{. DetailUrl }}) {{ toHtml . Title }} **
> Channel : < font color = "warning" > {{ if . ChannelName }}{{. ChannelName }}{{ else }} None {{ end }} </ font >
> Severity : < font color = "warning" > {{. IncidentSeverity }} </ font >
> Trigger Time : {{ date "2006-01-02 15:04:05" . StartTime }}
> Duration : {{ ago . StartTime }}{{ if gt . AlertCnt 1 }}
> Grouped Alerts : {{. AlertCnt }}{{ end }}
< br /> [ Details ]({{. DetailUrl }}) | [ Acknowledge ]({{. DetailUrl }}? ack = 1 )
Max message ~15000 characters, truncated if exceeded. Default Template :{{ fireReason .}} INC < {{. DetailUrl }} | #{{. Num }} > {{ toHtml . Title }}
-----
Channel : {{ if . ChannelName }}{{. ChannelName }}{{ else }} None {{ end }}
Severity : {{. IncidentSeverity }}
Trigger Time : {{ date "2006-01-02 15:04:05" . StartTime }}
Duration : {{ ago . StartTime }}{{ if gt . AlertCnt 1 }}
Grouped Alerts : {{. AlertCnt }}{{ end }}
-----
< br />< {{. DetailUrl }} | Details >|< {{. DetailUrl }}? ack = 1 | Acknowledge >
Max message 4096 characters, won’t send if exceeded. Requires configuring a Telegram service address accessible from your region. Default Template :{{ fireReason .}} INC [#{{. Num }}]({{. DetailUrl }}) {{ toHtml . Title }}
-----
Channel : {{ if . ChannelName }}{{. ChannelName }}{{ else }} None {{ end }}
Severity : {{. IncidentSeverity }}
Trigger Time : {{ date "2006-01-02 15:04:05" . StartTime }}
Duration : {{ ago . StartTime }}
< br /> [ Details ]({{. DetailUrl }}) | [ Acknowledge ]({{. DetailUrl }}? ack = 1 )
Other Channels
Default Template :You have a pending incident : {{ toHtml . Title }}, Channel : {{. ChannelName }}, Severity : {{. IncidentSeverity }}{{ if gt . AlertCnt 1 }}, {{. AlertCnt }} alerts grouped {{ end }}
Default Template :You have a pending incident : {{ toHtml . Title }}, Channel : {{. ChannelName }}, Severity : {{. IncidentSeverity }}{{ if gt . AlertCnt 1 }}, {{. AlertCnt }} alerts grouped {{ end }}
Supports full HTML format. Default template provides professional email layout including incident title, severity, channel, trigger time, responders, plus “Acknowledge Now” and “View Details” buttons.
Configure Escalation Rules Define incident notification rules and escalation mechanisms
Configure Personal Preferences Customize notification time periods and channel preferences