Forums

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

Email template: Issue description is null

Philipp Hartl June 12, 2023

Hello guys,

i have this line in my email template of the listener:

<p>Issue Description:$issue.description</p>
What if the issue description is empty, therefore getting value = "null" in the mail. Is it possible to write an if statement that if issue.description = null, another description is provided such as "No Description" 
Thanks for your help!

1 answer

0 votes
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2023

I assume this is velocity, and inside a pre block, so https://cwiki.apache.org/confluence/display/VELOCITY/CheckingForNull

 

<p>Issue Description:#if($issue.description)$issue.description#{else}No description#end</p>

which is ugly due to the formatting you provided

#if ($issue.description)
<p>Issue Description:$issue.description</p>
#else
<p>Issue Description:No description</p>
#end

 

Whatever you want to do with it, either should work.

Suggest an answer

Log in or Sign up to answer