Forums

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

IF Statement in the Content section of Send Email Automation

Tony Landowski September 30, 2024

I'm trying to write an IF statement for the Content section of the Send Email Automation. I have a list of fields and I want the Header and the value to show only if the value is not empty. However, the Header in this example "Business Reason Other" is consistently showing. Is there a way to modify this so that it only shows when the value is not empty?

 

{{ #if (issue.customField_10323.isNotEmpty) }} Business Reason Other: {{issue.customField_10323}} {{ /if}}

1 answer

1 accepted

2 votes
Answer accepted
Stephen_Lugton
Community Champion
October 1, 2024

@Tony Landowski 

I misread the question at first as being if/else, but try separating it out into 2 IF statements, it looks like having both a text value and a smart value messed it up:

{{#if(issue.customField_10323.isNotEmpty)}}Business Reason Other: {{/}}{{#if(issue.customField_10323.isNotEmpty)}}{{issue.customField_10323}}{{/}}

Stephen_Lugton
Community Champion
October 1, 2024

Actually I just tried out my version of

{{#if(issue.customField_10323.isNotEmpty)}}Business Reason Other: {{issue.customField_10323}}{{/}}

and it worked ok, so maybe it's the spaces before and after #if that it doesn't like

Tony Landowski October 1, 2024

Stephen, that is what the issue was.  Thank you very much for your help

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events