Help and Documentation
Liquid
Incident Variables
10min
You can use incident variables in different part of our application like:
- Slack title format
- Postmortem templates
- Genius workflow blocks
- etc.
Use our new Liquid Markup explorer to navigate through all incident variables.
We are using Liquid template language and available variables are:
Ruby
1{{ incident.id }} # returns string
2{{ incident.sequential_id }} # returns integer
3{{ incident.slug }} # returns string
4{{ incident.title }} # returns string
5{{ incident.summary }} # returns string
6{{ incident.status }} # returns string
7{{ incident.labels }} # returns array
8{{ incident.timeline }} # returns array
9{{ incident.timeline_table }} # returns string
10{{ incident.timeline_table_markdown }} # returns string
11{{ incident.timeline_table_markdown2 }} # returns string
12{{ incident.timeline_table_atlassian }} # returns string
13# DEPRECATED {{ incident.status_page_timeline }} # returns array
14# DEPRECATED {{ incident.status_page_timeline_table }} # returns string
15# DEPRECATED {{ incident.status_page_timeline_table_markdown }} # returns string
16# DEPRECATED {{ incident.status_page_timeline_table_markdown2 }} # returns string
17# See section below for new way
18{{ incident.severity }} # returns string
19{{ incident.severity_slug }} # returns string
20{{ incident.environments }} # returns array
21{{ incident.environment_slugs }} # returns array
22{{ incident.raw_environments }} # returns array of objects
23{{ incident.types }} # returns array
24{{ incident.types_slugs }} # returns array
25{{ incident.raw_types }} # returns array of objects
26{{ incident.services }} # returns array
27{{ incident.services_slug }} # returns array
28{{ incident.raw_services }} # returns array of objects
29{{ incident.functionalities }} # returns array
30{{ incident.functionality_slugs }} # returns array
31{{ incident.raw_functionalities }} # returns array of objects
32{{ incident.groups }} # returns array
33{{ incident.group_slugs }} # returns array
34{{ incident.raw_groups }} # returns array of objects
35{{ incident.created_at }} # returns datetime
36{{ incident.started_at }} # returns datetime
37{{ incident.detected_at }} # returns datetime
38{{ incident.acknowledged_at }} # returns datetime
39{{ incident.mitigated_at }} # returns datetime
40{{ incident.resolved_at }} # returns datetime
41{{ incident.time_to_mitigation }} # returns integer (in hours)
42{{ incident.mitigation_message }} # return string
43{{ incident.time_to_resolution }} # returns integer (in hours)
44{{ incident.resolution_message }} # return string
45{{ incident.time_to_detection }} # returns integer (in hours)
46{{ incident.detection_duration }} # returns integer (in seconds)
47{{ incident.time_to_mitigation }} # returns integer (in hours)
48{{ incident.mitigation_duration }} # returns integer (in seconds)
49{{ incident.time_to_acknowledge }} # returns integer (in hours)
50{{ incident.acknowledge_duration }} # returns integer (in seconds)
51{{ incident.duration }} # returns integer (in seconds)
52{{ incident.url }} # returns string
53{{ incident.short_url }} # returns string
54{{ incident.postmortem_url }} # returns string
55{{ incident.notify_emails }} # returns array of string
56{{ incident.creator }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
57{{ incident.in_tria }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
58{{ incident.started_by }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
59{{ incident.mitigated_by }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
60{{ incident.resolved_by }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
61{{ incident.cancelled_by }} # returns object eg. {"id":49, "name":"John Doe", "email":"[email protected]"}
62{{ incident.roles }} # returns array of objects eg. [{"incident_role": {"name" : "Commander"}, "user": {name: "John Doe", email: "[email protected]"}}]
63{{ incident.custom_fields }} # returns array of objects eg. [{"custom_fields": {"slug" : "my-custom-field"}, "selected_options": {value: ["Foo", "Bar"]}}]
64{{ incident.scheduled_for }} # Returns datetime
65{{ incident.scheduled_until }} # Returns datetime
66
67# Integrations
68{{ incident.zoom_meeting_id }} # returns string
69{{ incident.zoom_meeting_start_url }} # returns string
70{{ incident.zoom_meeting_join_url }} # returns string
71{{ incident.webex_meeting_id }} # returns string
72{{ incident.webex_meeting_url }} # returns string
73{{ incident.shortcut_story_id }} # returns string
74{{ incident.shortcut_story_url }} # returns string
75{{ incident.shortcut_task_id }} # returns string
76{{ incident.shortcut_task_url }} # returns string
77{{ incident.asana_task_id }} # returns string
78{{ incident.asana_task_url }} # returns string
79{{ incident.jira_issue_id }} # returns string
80{{ incident.jira_issue_key }} # returns string
81{{ incident.jira_issue_url }} # returns string
82{{ incident.google_meeting_id }} # returns string
83{{ incident.google_meeting_url }} # returns string
84{{ incident.trello_card_id }} # returns string
85{{ incident.trello_card_url }} # returns string
86{{ incident.linear_issue_id }} # returns string
87{{ incident.linear_issue_key }} # returns string
88{{ incident.linear_issue_url }} # returns string
89{{ incident.zendesk_ticket_id }} # returns string
90{{ incident.zendesk_ticket_url }} # returns string
91{{ incident.slack_channel_name }} # returns string
92{{ incident.slack_channel_id }} # returns string
93{{ incident.slack_channel_url }} # returns string
94{{ incident.slack_channel_short_url }} # returns string
95{{ incident.service_now_incident_id }} # returns string
96{{ incident.service_now_incident_url }} # returns string
97{{ incident.opsgenie_incident_id }} # returns string
98{{ incident.opsgenie_incident_url }} # returns string
99{{ incident.victor_ops_incident_id }} # returns string
100{{ incident.victor_ops_incident_url }} # returns string
101{{ incident.pagerduty_incident_id }} # returns string
102{{ incident.pagerduty_incident_number }} # returns string
103{{ incident.pagerduty_incident_url }} # returns string
104{{ incident.mattermost_channel_id }} # returns string
105{{ incident.mattermost_channel_name }} # returns string
106{{ incident.mattermost_channel_url }} # returns string
107{{ incident.confluence_page_id }} # returns string
108{{ incident.confluence_page_url }} # returns string
109{{ incident.airtable_base_key }} # returns string
110{{ incident.airtable_table_name }} # returns string
111{{ incident.airtable_record_id }} # returns string
112{{ incident.airtable_record_url }} # returns string
113{{ incident.google_drive_id }} # returns string
114{{ incident.google_drive_url }} # returns string
115{{ incident.notion_page_id }} # returns string
116{{ incident.notion_page_url }} # returns string
117{{ incident.datadog_notebook_id }} # returns string
118{{ incident.datadog_notebook_url }} # returns string
119{{ incident.freshservice_ticket_id }} # returns string
120{{ incident.freshservice_ticket_url }} # returns string
121{{ incident.freshservice_task_id }} # returns string
122{{ incident.freshservice_task_url }} # returns string
123{{ incident.service_now_incident_id }} # returns string
124{{ incident.service_now_incident_url }} # returns string
Ruby
1incident-{{ incident.started_at | date: "%Y%m%d" }}-{{ incident.slug }}
2# Will result of: incident-20210412-customers-unable-to-place-orders-on-our-website
3incident-{{ incident.created_at | date: "%Y%m%d" }}-{{ incident.jira_issue_url | split: "/" | last}}
4# Will result of: incident-20210412-ROOT-233
5{{ incident.created_at | in_time_zone: "Europe/London" | date: "%Y-%m-%d" }}
6# Will result of: 2021-04-12
Ruby
1{%- for role in incident.roles -%}
2 {%- if role.user -%}
3 {{ role.incident_role.name }} : {{ role.user.full_name }}
4 {%- else -%}
5 {{ role.incident_role.name }} : N/A
6 {%- endif -%}
7{%- endfor -%}
8
9# Will result of:
10# Commander: John Doe
11# Scriber: N/A
Ruby
1# Text Field
2{{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options.value' }}
3
4# Select & Multi Select
5{{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_options' | map: 'value' }}
6
7# Select & Multi Select using Teams options
8{{ incident.custom_fields | find: 'custom_field.slug', 'custom-field-groups' | get: 'selected_groups' | map: 'name' }}
9
10# Select & Multi Select using Services options
11{{ incident.custom_fields | find: 'custom_field.slug', 'custom-field-services' | get: 'selected_services' | map: 'name' }}
12
13# Users Field
14{{ incident.custom_fields | find: 'custom_field.slug', 'your_custom_field_slug' | get: 'selected_users' | map: 'full_name' }}
Ruby
1{% for item in incident.events %}
2 {{ item.occurred_at }} - {{ item.event }}
3{% endfor %}
Ruby
1# ASCII Table
2{{ incident.events | to_table: 'events', 'Hello world', 'America/Los_Angeles' }}
3# Returns
4# +---------------------------------------------------+
5# | Hello world |
6# +------------------------------+----------+---------+
7# | Date | User | Event |
8# +------------------------------+----------+---------+
9# | December 8 2022 23:04:28 PST | John D | Event 1 |
10# | December 8 2022 23:04:28 PST | Dalyte K | Event 2 |
11# +------------------------------+----------+---------+
12
13# Markdown table
14{{ incident.events | to_table: 'events', 'Hello world', 'America/Los_Angeles', 'markdown' }}
15# Returns
16# | Hello world |
17# |------------------------------|----------|---------|
18# | Date | User | Event |
19# | December 8 2022 23:04:28 PST | John D | Event 1 |
20# | December 8 2022 23:04:28 PST | Dalyte K | Event 2 |
21
22# Atlassian table
23{{ incident.events | to_table: 'events', 'Hello world', 'America/Los_Angeles', 'atlassian_markdown' }}
24# Returns
25# h2. Hello world
26
27# ||Date||User||Event||
28# |December 8 2022 23:04:28 PST|John D|Event 1. [Link|https://dummy]|
29# |December 8 2022 23:04:28 PST|Dalyte K|Event 2. [Link|https://dummy]|
30
31# HTML table
32{{ incident.events | to_table: 'events', 'Hello world', 'America/Los_Angeles', 'html' }}
33# Returns
34# <h2>Hello world</h2>
35
36# <table>
37# <tr>
38# <th>Date</th>
39# <th>User</th>
40# <th>Event</th>
41# </tr>
42# <tr>
43# <td>December 8 2022 23:04:28 PST</td>
44# <td>John D</td>
45# <td>Event 1</td>
46# </tr>
47# <tr>
48# <td>December 8 2022 23:04:28 PST</td>
49# <td>Dalyte K</td>
50# <td>Event 2</td>
51# </tr>
52# </table>
Ruby
1{% for item in incident.action_items %}
2 {{ item.summary }}
3 Kind: {{item.kind}}
4 Priority: {{item.priority}}
5 Status: {{item.status}}
6{% endfor %}
Ruby
1# ASCII Table
2{{ incident.action_items | to_table: 'action_items', 'Hello world', 'America/Los_Angeles' }}
3# Returns
4# +------------------------------------------------------------------------------------------------------------------------+
5# | Hello world |
6# +------------------------------+------------------------------+-----------+----------+--------+----------+---------------+
7# | Creation Date | Due Date | Kind | Priority | Status | Assignee | Summary |
8# +------------------------------+------------------------------+-----------+----------+--------+----------+---------------+
9# | December 7 2022 23:04:28 PST | December 8 2022 00:00:00 PST | Task | Low | Open | John D | Action Item 1 |
10# | December 7 2022 23:04:28 PST | December 8 2022 00:00:00 PST | Follow Up | High | Done | Dalyte K | Action Item 2 |
11# +------------------------------+------------------------------+-----------+----------+--------+----------+---------------+
12
13# Markdown table
14{{ incident.action_items | to_table: 'action_items', 'Hello world', 'America/Los_Angeles', 'markdown' }}
15# Returns
16# | Hello world |
17# |------------------------------|------------------------------|-----------|----------|--------|----------|---------------|
18# | Creation Date | Due Date | Kind | Priority | Status | Assignee | Summary |
19# | December 7 2022 23:04:28 PST | December 8 2022 00:00:00 PST | Task | Low | Open | John D | Action Item 1 |
20# | December 7 2022 23:04:28 PST | December 8 2022 00:00:00 PST | Follow Up | High | Done | Dalyte K | Action Item 2 |
21
22# Atlassian table
23{{ incident.action_items | to_table: 'action_items', 'Hello world', 'America/Los_Angeles', 'atlassian_markdown' }}
24# Returns
25# h2. Hello world
26# ||Creation Date||Due Date||Kind||Priority||Status||Assignee||Summary||
27# |December 7 2022 23:04:28 PST|December 8 2022 00:00:00 PST|Task|Low|Open|John D|Action Item 1. [Link|https://dummy]|
28# |December 7 2022 23:04:28 PST|December 8 2022 00:00:00 PST|Follow Up|High|Done|Dalyte K|Action Item 2. [Link|https://dummy]|
29
30# HTML table
31{{ incident.action_items | to_table: 'action_items', 'Hello world', 'America/Los_Angeles', 'html' }}
32# Returns
33# <h2>Hello world</h2>
34#
35# <table>
36# <tr>
37# <th>Creation Date</th>
38# <th>Due Date</th>
39# <th>Kind</th>
40# <th>Priority</th>
41# <th>Status</th>
42# <th>Assignee</th>
43# <th>Summary</th>
44# </tr>
45# <tr>
46# <td>December 7 2022 23:04:28 PST</td>
47# <td>December 8 2022 00:00:00 PST</td>
48# <td>Task</td>
49# <td>Low</td>
50# <td>Open</td>
51# <td>John D</td>
52# <td>Action Item 1</td>
53# </tr>
54# <tr>
55# <td>December 7 2022 23:04:28 PST</td>
56# <td>December 8 2022 00:00:00 PST</td>
57# <td>Follow Up</td>
58# <td>High</td>
59# <td>Done</td>
60# <td>Dalyte K</td>
61# <td>Action Item 2</td>
62# </tr>
63# </table>
Ruby
1# Find
2# Input: {"books": [{ "id": 1, title: "hello" }, { "id": 2, title: "world" }] }
3# Output: { "id": 2, title: "world" }
4
5{ hash.books | find: 'id', '2' }
6
7# Get
8# Input: {"books": [{ "id": 1, title: "hello", category: {name: "History"} }}, { "id": 2, title: "world", category: {name: "SciFi"} }] }
9# Output: "SciFi"
10
11{ hash.books | find: 'id', '2' | get: 'category.name'}
12
13# in_time_zone
14
15{ 'now' | in_time_zone: "Europe/London" }
16
17# smart_date
18
19{ 'now' | smart_date: '2 days ago' }
20{ 'now' | smart_date: '2 days ago' | in_time_zone: "Europe/London" }
21{ 'now' | smart_date: '4 days from now' | in_time_zone: "Europe/London" }
22{ 'now' | smart_date: 'yesterday' | in_time_zone: "Europe/London" }
23
24# iso8601
25
26{ 'now' | to_iso8601 }
27
28# Distance of time in words
29{ 'now' | smart_date: '2 days ago' | distance_of_time_in_words_from_now } # 2 days
Updated 19 Mar 2024
Did this page help you?