Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can the IF or #IF work in the automation rule for sending emails?

Vina Wu
December 10, 2025

Request: In the JSM automation rule for sending emails, the email body needs to display the value of a field from a form. If the field is empty, it should display "null"; otherwise, it should display the field value directly.

Below is a rule written using "if" or "#if", but the correct value is not displayed in the email body.

Could you tell me what's wrong? thanks.  Both methods should display "ssds", but currently the IF statement returns null, and the #if statement returns empty.

for if statement: {{if(issue.customfield_12345, issue.customfield_12345, "null")}}

 

for #if statement:

{{#if(issue.customfield_12345)}}

{{issue.customfield_12345}}

{{else}}

null

{{/}}

111.png

2 answers

1 accepted

2 votes
Answer accepted
Tomislav Tobijas
Community Champion
December 11, 2025

Hey @Vina Wu ,

Instead of using if and #if statements, can you try using default value syntax to display "null" when the field is empty:

{{issue.customfield_12345|"null"}}
This should show the field value if it exists, or "null" if it is empty or missing.
Cheers,
Tobi
Vina Wu
December 11, 2025

thank you so much.

Like # people like this
0 votes
Christos Markoulatos
Community Champion
December 11, 2025

Hi @Vina Wu welcome

what field type is customfield_12345 single-select, text?

Vina Wu
December 11, 2025

it's text.

thank you Christos.  got the right way from Tomislav

Like Susan Waldrip likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events