Template Filters

Transform values using | (pipe) syntax: {{ value | filter }}.


General Filters

Filter Description Example
default(value) Fallback for null/empty {{ name | default("Unknown") }}
coalesce(v1, v2, ...) First non-empty value {{ a | coalesce(b, c) }}
empty Check if value is empty {% if items | empty %}No items{% endif %}
len Get length {{ items | len }}

String Filters

Filter Description Example
upper Uppercase {{ "hello" | upper }} → HELLO
lower Lowercase {{ "HELLO" | lower }} → hello
capitalize Capitalize first letter {{ "hello" | capitalize }} → Hello
trim Remove whitespace {{ " text " | trim }} → text
truncate(n, suffix) Truncate to n chars {{ text | truncate(50) }}
replace(old, new) Replace substring {{ text | replace("a", "b") }}
split(separator) Split into array {{ "a,b,c" | split(",") }}
join(separator) Join array to string {{ labels | join(", ") }}
match(regex) Test regex match {% if key | match("^PROJ-") %}...{% endif %}

Number Filters

Filter Description Example
round Round to nearest integer {{ 3.7 | round }} → 4
ceil Round up {{ 3.2 | ceil }} → 4
floor Round down {{ 3.9 | floor }} → 3
formatNumber(locale) Format with locale {{ 1234.5 | formatNumber("en-US") }} → 1,234.5
percent(digits) Format as percentage {{ 0.75 | percent(1) }} → 75.0%

Array Filters

Filter Description Example
first First element {{ items | first }}
last Last element {{ items | last }}
uniq Remove duplicates {{ labels | uniq }}
reverse Reverse order {{ items | reverse }}
slice(start, count) Get slice of array {{ items | slice(0, 5) }}
take(n) Take first n items {{ items | take(3) }}
sortBy(path, desc) Sort by property {{ issues | sortBy("fields.priority.id") }}
map(path) Extract property from each {{ issues | map("key") }}
filter(path, op, value) Filter by condition {{ issues | filter("fields.status.name", "==", "Done") }}

Filter operators: ==, !=, >, >=, <, <=, includes, contains


Date Filters

Filter Description Example
date(format, timezone) Format date {{ created | date("yyyy-MM-dd") }}
fromNow Relative time {{ updated | fromNow }} → “2 hours ago”
addDays(n) Add days {{ duedate | addDays(7) }}
addHours(n) Add hours {{ created | addHours(24) }}

Date format tokens: yyyy, MM, dd, HH, mm, ss

addDays / addHours return an ISO-8601 string, not a date object. When the result goes into JQL, wrap it in quotes: duedate <= "{{ now() | addDays(7) }}". Chain | date(...) if you need a different display format.


HTML Filters

Filter Description Example
nl2br Newlines to <br/> {{ text | nl2br }}
escapeAttr Escape for HTML attributes <a title="{{ text | escapeAttr }}">
urlEncode URL encode {{ text | urlEncode }}
json(indent) Convert to JSON {{ data | json(2) }}
jsonHtml(indent) JSON with <br/> {{ data | jsonHtml }}

Jira-Specific Filters

Filter Description Example
issueLink Issue key as text {{ linked.key | issueLink }}
jqlRaw Insert a value into JQL without escaping project = {{ issue.fields.project.id | jqlRaw }}

Filter Details:

  • issueLink - Returns the issue key as a string; it does not build a URL. Passing it an issue object gives you [object Object], so always pipe the key itself: {{ linked.key | issueLink }}. To render a clickable link, write the anchor yourself: <a href="/browse/{{ linked.key }}">{{ linked.key }}</a>.
  • jqlRaw - Inserts the value into the JQL string as-is, without escaping. Use it for identifiers such as project keys, issue keys and numeric IDs, where escaping would break the query. Because nothing is escaped, only trusted identifier sources belong here (issue.fields.project.id, issue.key, currentUser.accountId); never pipe free-form user input through jqlRaw - it lands in the query unchanged.

Chaining Filters

Filters can be chained together:

{{ linkedIssues | filter("fields.status.name", "!=", "Done") | sortBy("fields.priority.id") | take(5) }}
{{ issue.fields.summary | lower | truncate(50) }}
{{ issue.fields.labels | uniq | join(", ") | default("No labels") }}

Next Steps