Template variables and {{ … }} reference
Complete reference for the
{{ … }}substitution language used by Custom JSON templates and by URL / headers / query parameters on the webhook form. Read Custom JSON template first for the conceptual model — this page is the dictionary.
Root context — always available
These identifiers can start any placeholder path:
Identifier | Description |
|---|---|
| Forge event key, e.g. |
| ISO 8601 delivery timestamp, e.g. |
|
|
| Jira site URL, e.g. |
| e.g. |
| numeric — |
Family-specific bindings
Set according to the event family. Bindings that don't apply to the current event stay null, so unused {{ … }} paths resolve cleanly without breaking JSON.
Binding | Populated for events | Source |
|---|---|---|
| Issue, Comment, Worklog, Attachment, Issue Link | REST API (or event snapshot) |
|
| event snapshot |
|
| event snapshot |
|
| event snapshot |
|
| event snapshot |
| All project lifecycle events | event snapshot |
| All version lifecycle events | event snapshot |
| All component lifecycle events | event snapshot |
| All user lifecycle events | event snapshot |
| All filter lifecycle events | event snapshot |
| All issue-type lifecycle events | event snapshot |
| All custom field lifecycle events | event snapshot |
| All custom field context lifecycle events | event snapshot |
| Any event — alias for whichever binding above is populated | — |
{{entity.…}} is the family-agnostic escape hatch. Use it for templates that should handle several event types and only need common properties like {{entity.id}}, {{entity.name}}.
Path syntax
Dot-notation only. No numeric [0] indices.
{{issue.key}}
{{issue.status.name}}
{{issue.assignee.displayName}}
{{comment.body.content.first.content.first.text}}
{{baseUrl}}/browse/{{issue.key}}The .fields shortcut
You can skip the .fields. hop when reaching into a Jira issue:
{{issue.summary}} ← shortcut
{{issue.fields.summary}} ← explicit form, also worksThe resolver checks top-level (key, id, self, changelog, …) first, then .fields.
Array accessors — first, last, length
Three special segment names that work on any array-like value:
{{issue.comment.first}} → first comment (object)
{{issue.comment.last}} → most recent comment
{{issue.comment.length}} → number of comments on this page
{{issue.comment.first.body.content}} → ADF body content of the first comment
{{issue.comment.first.author.displayName}} → "John Doe"
{{issue.worklog.last.timeSpent}} → time on the latest worklog
{{issue.labels.first}} → first label (string)
{{issue.labels.length}} → label count
{{issue.fixVersions.last.name}} → most recent fix version's nameThese work on:
Plain arrays (
labels,fixVersions,attachment,subtasks, …).Jira pagination wrappers (
comment,worklog) — peek into the inner array automatically.
If a real Jira field happens to be named first / last / length, regular property access wins for objects; the virtual accessor only triggers when the current value is array-like.
Pagination wrapper auto-unwrap
Jira returns some fields wrapped in pagination envelopes:
issue.comment = { comments: […], total, maxResults, startAt }
issue.worklog = { worklogs: […], total, maxResults, startAt }Picking these in a Fields template, or writing {{issue.comment}} in Custom JSON, returns the inner array directly — no extra .comments / .worklogs hop needed.
If you want the envelope itself, keep going on the path:
{{issue.comment.total}} → 3
{{issue.comment.maxResults}} → 1
{{issue.comment.startAt}} → 0Detection is structural: any future Jira field with the { inner-array, total, maxResults, startAt } shape unwraps automatically.
Comment / worklog / attachment fields on the issue
Webhooks Pro asks Jira for these explicitly so they're always populated when present:
GET /rest/api/3/issue/{key}?fields=*all,comment,worklog,attachment&expand=renderedFields,changelogSo {{issue.comment}}, {{issue.worklog}}, {{issue.attachment}} always return the data when the issue has any. Custom-field rendered HTML (expand=renderedFields) is included for templates that need the HTML form of a wiki-marked field. changelog is included so templates can inspect what changed: {{issue.changelog.histories.last.items}}.
ADF body structure
Comments and rich-text custom fields come back as Atlassian Document Format — a tree of nodes, not plain text:
{
"type": "doc",
"content": [
{ "type": "paragraph", "content": [
{ "type": "text", "text": "First line" }
] },
{ "type": "paragraph", "content": [
{ "type": "text", "text": "Second line, " },
{ "type": "mention", "attrs": { "id": "..." } }
] }
]
}body.content → array of block nodes (paragraph, heading, bulletList, …). Each block has content → array of inline nodes (text, mention, emoji, …). Plain text lives two levels deep, not directly on the block.
Combined with first / last:
{{comment.body.content.first.content.first.text}}
→ "First line"
{{comment.body.content.last.content.first.text}}
→ "Second line, " (the mention is the second inline node)For a flat string, pull the whole body and let the receiver flatten — flatten logic depends on what the downstream expects (mentions as @username vs ids, emoji as unicode vs shortcode).
Workflow post function — entity.* bindings
When a webhook fires from the Trigger Webhook post function (Trigger Webhook post function), an extra snapshot under entity covers the transition that ran:
Path | Description |
|---|---|
| Jira transition id |
| Transition name (e.g. |
| Source status object ( |
| Source status name |
| Target status id |
| Target status name |
| Workflow id |
| Workflow name |
| Array of |
| First changed field on this transition |
| New value of that field |
| Comment entered in Jira's transition dialog (full object) |
| Comment author |
| ADF body |
{{issue.*}} is also available on post-function deliveries — the post function passes the full issue alongside entity.
The transition comment is enriched server-side: Forge delivers a slim stub { id: "10248" }; Webhooks Pro looks it up in the issue's fields.comment.comments[] and swaps the stub with the full comment object so entity.comment.body, .author, .created all resolve.
Formatters
Append :type(pattern) to a placeholder for explicit formatting:
Type | Purpose | Pattern |
|---|---|---|
| Format a numeric value | DecimalFormat tokens (see below) |
| Format a | UTC tokens (see below) |
| Force | none |
| Force string coercion | none |
Unknown formatter types raise a render warning → the delivery falls back to Default and the log shows the message.
Date patterns (UTC, deterministic)
Token | Example | Meaning |
|---|---|---|
|
| Full year |
|
| Two-digit year |
|
| Month name (full, English) |
|
| Month name (abbreviated) |
|
| Month number (01–12) |
|
| Day of week (full, English) |
|
| Day of week (abbreviated) |
|
| Day of month (01–31) |
|
| Hour 24h (00–23) |
|
| Minute (00–59) |
|
| Second (00–59) |
|
| Millisecond (000–999) |
Other characters in the pattern are kept as literals. Without a pattern, :date returns the ISO string.
{{issue.updated:date(yyyy-MM-dd HH:mm)}} → "2026-05-04 10:30"
{{issue.duedate:date(dd/MM/yyyy)}} → "15/05/2026"Number patterns
Token | Meaning |
|---|---|
| Required digit (pads with |
| Optional digit (omitted when zero) |
| Decimal separator |
| Thousands separator |
| Percent (multiplies by 100, appends |
{{sp:number(0.00)}} for sp = 3.1 → "3.10"
{{sp:number(0.##)}} for sp = 3.1 → "3.1"
{{amount:number(#,##0)}} for 12345 → "12,345"
{{amount:number(#,##0.00)}} for 1234.5 → "1,234.50"
{{progress:number(0%)}} for 0.75 → "75%"Without a pattern, :number returns the default String(number).
Null / undefined with formatters
When a formatter is applied, missing values produce an empty string "" — regardless of type. (For whole-quote placeholders without a formatter, missing values become null.)
Substitution modes (Custom JSON only)
Position | Behaviour |
|---|---|
Whole-quote | Replaces the wrapping |
In-string | Substitutes a string. Objects/arrays are |
In URL / headers / query params, only the in-string mode applies (those are plain strings, not JSON).
URL, headers, and query params
The same {{ … }} syntax works in Webhook URL, HTTP Headers (key and value), and URL Parameters (key and value):
URL https://api.example.com/issues/{{issue.key}}/events
Header X-Issue-Key = {{issue.key}}
Header X-Event = {{event}}
Query project = {{issue.project.key}}
Query date = {{timestamp:date(yyyy-MM-dd)}}In the URL, substituted values are URL-encoded automatically (encodeURIComponent). Literal characters (:, /, ?, =, #) stay as written.
In headers, substituted values are not URL-encoded (HTTP doesn't require it). In query params, values are encoded when assembled into the URL — that's what URLSearchParams does natively.
Don't put secrets in placeholders. Authorization / API keys belong in literal header values. Pulling a token from
{{issue.customfield_…}}leaks it into delivery logs.
The URL path itself (the static parts you wrote) is not substituted — only {{ … }} segments are. If you need a fully dynamic URL path, build it from query parameters or route on the receiver side.
Render warnings to watch for
In Webhook Logs, the error column on a delivery row surfaces:
[WARNING] Header "X-Foo" render failed: …— a header / query placeholder produced an invalid value or used an unknown formatter.[WARNING] Custom JSON template render failed: …— the body didn't parse after substitution. The delivery falls back to Default.
Both are non-fatal — the delivery still goes out — but indicate a template bug worth fixing.
Related
Custom JSON template — the conceptual model.
Fields template — the simpler alternative.
The built-in Default template — what fall-back deliveries look like.
Headers and authentication — header values that use
{{ … }}.Webhook logs — where render warnings appear.