Skip to main content
Rootly registers the filters below on top of the standard Liquid filters. Use them anywhere you can author a Liquid template — workflow tasks, message templates, post-mortem templates, custom field templates, and the in-product Liquid Explorer.

Fallback Values

When a Liquid expression might resolve to nil — a missing field, an absent JSON path, an empty array — chain the standard Liquid default filter to fall back to another expression. This is the recommended pattern for alert-field mappings that need to coalesce across multiple possible payload paths.
JS
The expression resolves to alert.data.data.srcip when present, otherwise to alert.data.data.terminal_ip. Chain multiple defaults for longer fallback chains:
JS
The final "unknown" literal guarantees a non-empty string output even when every JSON path is missing — useful for fields that downstream workflow conditions or alert routes depend on.
default treats empty strings and empty arrays as truthy. If you want the fallback to fire on empty values too, pass allow_false: true: {{ value | default: "fallback", allow_false: true }}. Standard Liquid semantics.

Lookups & Filtering

find

  • find: arg1, 'arg2'
    • arg1. String
    • arg2. String
JS

where

Filters an array, returning every element that matches. Pair with find (returns the first match) when you need all results.
  • where: 'arg1', 'arg2'
    • arg1. String — key path, dot-separated for nested lookups
    • arg2. String (optional) — when omitted, keeps elements where arg1 is truthy
JS

get

  • get: 'arg'
    • arg. String
JS

slice

  • slice: '\*arg'
    • arg. String
    • … As many args as you need
JS

Arrays & Hashes

flatten

  • flatten
JS

push

Appends a value to the end of an array. A comma-separated string is split into an array first.
  • push: 'arg'
    • arg. String
JS

pop

Removes the last n elements from an array.
  • pop: arg
    • arg. Integer (default 1)
JS

shift

Removes the first n elements from an array.
  • shift: arg
    • arg. Integer (default 1)
JS

unshift

Prepends a value to the start of an array. A comma-separated string is split into an array first.
  • unshift: 'arg'
    • arg. String
JS

keys

Returns the keys of a hash as an array. Useful for iterating slug-keyed objects like team.services, team.functionalities, and team.groups.
  • keys
JS

values

Returns the values of a hash as an array.
  • values
JS

to_values

  • to_values: 'key'
    • key is optional
JS

JSON

to_json

Also available as json.
  • to_json
JS

parse_json

Parses a JSON string into a hash or array — the inverse of to_json. Useful when an alert payload field arrives as a stringified JSON blob.
  • parse_json
JS
Returns the input unchanged if it can’t be parsed.

Dates & Time

smart_date

JS

date_add

  • date_add: amount, 'date_part'
    • amount. Integer (positive to add, negative to subtract)
    • date_part. String - one of: year, month, day, hour, minute, second, millisecond (plurals supported)
Adds a specified amount of time to a date. Works with ‘now’, ‘today’, ISO date strings, Time, and Date objects.
JS

date_minus

  • date_minus: amount, 'date_part'
    • amount. Integer (positive to subtract, negative to add)
    • date_part. String - one of: year, month, day, hour, minute, second, millisecond (plurals supported)
Subtracts a specified amount of time from a date. Works with ‘now’, ‘today’, ISO date strings, Time, and Date objects.
JS

to_iso8601

  • to_iso8601
JS

to_utc

  • to_utc
Converts a date to UTC timezone. Works with ‘now’, ‘today’, ISO date strings, Time, and Date objects.
JS
Useful for synchronizing incident timestamps with timeline values, ensuring all dates display in UTC regardless of user timezone.

in_time_zone

  • in_time_zone: 'time_zone'
    • time_zone. Any timezone listed in Timezones
JS
See Timezones for available values

distance_of_time_in_words

  • distance_of_time_in_words: 'arg', 'precise'
    • arg. String (optional)
    • precise. String (optional)
JS

distance_of_time_in_words_to_now

  • distance_of_time_in_words_to_now: 'precise'
    • precise. String (optional)
JS

Tables

to_table

  • to_table: 'table_type', 'title', 'time_zone', 'format'
    • table_type. String — events or action_items
    • title. String — table heading
    • time_zone. String — any timezone listed in Timezones
    • format. String — ascii, markdown, html, or atlassian_markdown
The events type renders timeline columns: Date, User, Event. The action_items type renders: Creation Date, Due Date, Kind, Priority, Status, Assignee, Summary.
JS

Regex

regex_match

Find first match and return array with full match and capture groups
  • regex_match: 'regex', 'flags'
    • regex a ruby regular expression
    • flags optional string with regex flags: ‘i’ (case insensitive), ‘m’ (multiline), ‘x’ (extended)
JS
JS
Perfect for extracting data from email alert payloads:
JS

regex_match_all

Find all matches and return array of results
  • regex_match_all: 'regex', 'flags'
    • regex a ruby regular expression
    • flags optional string with regex flags: ‘i’ (case insensitive), ‘m’ (multiline), ‘x’ (extended)
JS
JS
Ideal for parsing multiple values from alert payloads:
JS

regex_replace

Global replace
  • regex_replace: 'regex', 'replacement'
    • regexp a ruby regular expression
    • replacement a ruby regular expression
JS

regex_replace_first

First match replace
  • regex_replace_first: 'regex', 'replacement'
    • regexp a ruby regular expression
    • replacement a ruby regular expression
JS

regex_remove

Global match remove
  • regex_remove: 'regex'
    • regexp a ruby regular expression
JS

regex_remove_first

First match remove
  • regex_remove_first: 'regex'
    • regexp a ruby regular expression
JS

Slack Helpers

to_slack_markdown

Converts standard Markdown into Slack’s mrkdwn flavor (e.g., **bold** becomes *bold*, link syntax is rewritten, lists are formatted). Use in any task that posts to Slack.
  • to_slack_markdown
JS
Returns an empty string for non-string inputs.

format_text_for_slack

Escapes characters that would break a Slack JSON payload — converts double quotes to single quotes and escapes newlines and carriage returns.
  • format_text_for_slack
JS
Use when interpolating user-supplied text into a hand-built Slack Block Kit JSON payload.

String Manipulation

dasherize

  • dasherize
JS

parameterize

  • parameterize
    • separator (default to ’-‘)
JS

camelize

  • camelize
JS

titleize

  • titleize
JS

singularize

  • singularize
JS

pluralize

  • pluralize
JS

humanize

  • humanize
JS

shuffle

  • shuffle
JS

Encoding

base64_encode

Base64-encodes a string using strict encoding (no line breaks).
  • base64_encode
JS
Common use — build a Basic auth header for a workflow HTTP task:
JS

base64_decode

Decodes a strict-Base64 string. Raises a Liquid argument error on invalid input.
  • base64_decode
JS

base64_url_safe_encode

Base64-encodes using the URL-safe alphabet (- and _ instead of + and /).
  • base64_url_safe_encode
JS

base64_url_safe_decode

Decodes a URL-safe Base64 string.
  • base64_url_safe_decode
JS

Markdown & HTML

markdown_to_html

Renders Markdown to sanitized HTML — useful when an integration expects HTML input (e.g., email templates, webhook payloads).
  • markdown_to_html
JS
Output is sanitized to a safelist of tags and attributes; links get rel="nofollow noopener noreferrer". Returns an empty string for nil input.

html_to_markdown

Inverse of markdown_to_html. Handles most common HTML elements including headings, paragraphs, lists, links, code blocks, and tables.
  • html_to_markdown
JS
JS
Returns empty string for nil or empty input. Preserves original HTML on conversion errors.

URLs

shortener

  • shortener
JS

AI

open_ai_completion

Sends the input string to OpenAI as the user prompt and returns the completion text. Useful for inline summarization or text transformation directly inside a Liquid template.
  • open_ai_completion
JS
For most use cases, prefer the dedicated AI workflow tasks (Create OpenAI Chat Completion, Create Anthropic Chat Completion, etc.) over this filter — they expose model selection, system prompts, temperature, and message history, which this filter does not.
Returns "something went wrong" on failure.

Integration Converters

Rootly’s severity, priority, and status enums don’t always map 1-to-1 to vendor enums. Converter filters translate a Rootly value to the equivalent vendor value when building HTTP payloads or workflow task arguments. They take no extra arguments unless noted.
JS