Going Stellar

Home/Smart values reference

Jira Automation smart value

{{#if}} conditions in Jira Automation: syntax and examples

{{#if(condition)}}text{{/}} prints the text only when the condition is true. The function form if(condition, a, b) picks between two values. Conditions are usually a comparison, exists(), equals(), a boolean function such as contains(), or a combination with and(), or() and not().

Syntax

{{#if(condition)}}text{{/}}
{{if(condition, "value if true", "value if false")}}

Arguments

ArgumentWhat it isRequired
conditionA check that returns true or false, such as a comparison, exists(), equals() or contains()yes

Works on

  • Blocks: any text between {{#if()}} and {{/}}, including other smart values
  • Returns: the text or value when true, otherwise an empty string

Examples

{{#if(not(issue.labels.isEmpty))}}Labels: {{issue.labels.join(", ")}}{{/}}

Print the label list only when the work item has labels.

Result:

Labels: checkout, demo

Run on Jira Cloud on .

{{#if(issue.description.contains("wrong"))}}Mentions a wrong total{{/}}

Add a note when the description contains a word.

Result:

Mentions a wrong total

Run on Jira Cloud on .

{{#if(not(issue.issuelinks.isEmpty))}}This bug has {{issue.issuelinks.size}} related tickets{{/}}

The conditional comment from the docs as one line; with no links nothing is printed.

Run on Jira Cloud on .

{{if(issue.Votes, "Has votes", "No votes")}}

The function form with an else value.

Result:

No votes

Run on Jira Cloud on .

{{if(exists(issue.duedate), issue.duedate.format("dd/MM/yyyy"), "No due date")}}

Choose between a formatted date and a fallback text.

Result:

15/12/2026

Run on Jira Cloud on .

Where the documentation differs

  • {{if(issue.summary)}}

    Run on Jira Cloud, : the documentation says The docs say {{if(smartValue)}} returns true or null., the actual result is .

  • {{if(issue.summary, "Hello")}}

    Run on Jira Cloud, : the documentation says The docs say {{if(smartValue, "Hello")}} returns Hello or null., the actual result is .

  • {{if(issue.summary)}}Hello{{/}}

    Run on Jira Cloud, : the documentation says The docs say {{if(smartValue)}}Hello{{/}} returns Hello or null., the actual result is Error parsing template: Mismatched start/end tags: null != in template-f5b1359e-924b-4e4d-be3b-d48fd44aaf2e:1.

Pitfalls

  • The block form needs the hash: {{if(issue.summary)}}Hello{{/}} without it is rejected on save, although the docs write it that way (checked on Jira Cloud, November 2026).
  • The condition has to be a true or false value. {{#if(issue.summary)}}Hello{{/}} printed nothing on a work item with a summary, and {{if(issue.assignee, "Assigned", "Unassigned")}} printed Unassigned on an assigned work item. Use exists() or a comparison (checked on Jira Cloud, November 2026).

Sources

  1. Jira smart values: conditional logic (Atlassian Support)

Markdown version · All smart values