Skip to main content
You can use incident variables in different parts of Rootly like:
  • Slack title format
  • Postmortem templates
  • Genius workflow blocks
  • etc.

Variables

Use the Liquid Markup explorer to navigate through all incident variables.
Rootly uses the Liquid template language. The available variables are:
Ruby

Examples

Ruby

Reference a Single Role

To use one specific role — the commander in a page, the retrospective owner in a reminder — reference it directly by its slug rather than looping over every role and filtering:
Ruby
The value is the user assigned to that role, so the user fields hang directly off it — there is no .user step as there is inside the loop.
This shape holds for single-assignee roles only. A role configured to allow multiple assignees returns an array of users instead, so {{ incident["<role-slug>"].name }} renders nothing for it. Loop over it:
Check the role’s multiple-assignee setting before writing the template — the two shapes look identical until the role has more than one person in it.
Use bracket notation consistently. Any slug containing a hyphen breaks dot notation — {{ incident.post-mortem-owner }} is not valid Liquid, because the hyphens are read as subtraction. A single-word slug like commander would work either way, but writing every role the same way means you do not have to think about it: incident["post-mortem-owner"].
The slug is the role’s own slug, not its display name, and the two can diverge — a role displayed as “Retrospective Owner” may still carry the slug post-mortem-owner from before the terminology changed. Deriving the accessor from what you see on screen is how these templates break. Check the role in Incident Roles and copy the slug from there.
A role with nobody assigned returns nothing, and the surrounding text still renders. A message reading “Paging: ” with an empty space is easy to miss in a template that looked fine when you tested it against an incident that had the role filled.Guard it when the role is not guaranteed:
Ruby

List Roles

To render every role at once, loop instead. Note that inside the loop the user is one level down, under role.user:
Ruby

List Custom Fields

Ruby

List Timeline Events

Ruby

Convert Timeline Events to Table

Ruby

List Action Items

Ruby

Convert Action Items to Table

Ruby

Additional Filters

Ruby

Action Item Variables

Reference follow-ups linked to the incident from action item workflows.

Team Variables

Reference team attributes — owners, Slack channels, on-call responders — from workflows.

Alert Variables

Reference alert attributes from alert workflows and routing actions.