The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

5 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
Contributor
December 11, 2025

thank you so much.

Like • # people like this
1 vote
Christos Markoulatos -Relational-
Community Champion
December 11, 2025

Hi @Vina Wu welcome

what field type is customfield_12345 single-select, text?

Vina Wu
Contributor
December 11, 2025

it's text.

thank you Christos.  got the right way from Tomislav

Like • Susan Waldrip likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events