Fallback Values
When a Liquid expression might resolve tonil — 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
alert.data.data.srcip when present, otherwise to alert.data.data.terminal_ip. Chain multiple defaults for longer fallback chains:
JS
"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.
Lookups & Filtering
find
find: arg1, 'arg2'arg1. Stringarg2. String
JS
where
Filters an array, returning every element that matches. Pair withfind (returns the first match) when you need all results.
where: 'arg1', 'arg2'arg1. String — key path, dot-separated for nested lookupsarg2. String (optional) — when omitted, keeps elements wherearg1is 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 lastn elements from an array.
pop: argarg. Integer (default1)
JS
shift
Removes the firstn elements from an array.
shift: argarg. Integer (default1)
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 liketeam.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'keyis optional
JS
JSON
to_json
Also available asjson.
to_json
JS
parse_json
Parses a JSON string into a hash or array — the inverse ofto_json. Useful when an alert payload field arrives as a stringified JSON blob.
parse_json
JS
Dates & Time
smart_date
smart_date: 'arg'arg. String
- This is using https://github.com/mojombo/chronic under the hood.
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)
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)
JS
to_iso8601
to_iso8601
JS
to_utc
to_utc
JS
in_time_zone
in_time_zone: 'time_zone'time_zone. Any timezone listed in Timezones
JS
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 —eventsoraction_itemstitle. String — table headingtime_zone. String — any timezone listed in Timezonesformat. String —ascii,markdown,html, oratlassian_markdown
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 groupsregex_match: 'regex', 'flags'regexa ruby regular expressionflagsoptional string with regex flags: ‘i’ (case insensitive), ‘m’ (multiline), ‘x’ (extended)
JS
JS
JS
regex_match_all
Find all matches and return array of resultsregex_match_all: 'regex', 'flags'regexa ruby regular expressionflagsoptional string with regex flags: ‘i’ (case insensitive), ‘m’ (multiline), ‘x’ (extended)
JS
JS
JS
regex_replace
Global replaceregex_replace: 'regex', 'replacement'regexpa ruby regular expressionreplacementa ruby regular expression
JS
regex_replace_first
First match replaceregex_replace_first: 'regex', 'replacement'regexpa ruby regular expressionreplacementa ruby regular expression
JS
regex_remove
Global match removeregex_remove: 'regex'regexpa ruby regular expression
JS
regex_remove_first
First match removeregex_remove_first: 'regex'regexpa 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
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
String Manipulation
dasherize
dasherize
JS
parameterize
parameterizeseparator(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
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
rel="nofollow noopener noreferrer". Returns an empty string for nil input.
html_to_markdown
Inverse ofmarkdown_to_html. Handles most common HTML elements including headings, paragraphs, lists, links, code blocks, and tables.
html_to_markdown
JS
JS
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
"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