I want to display the last comment made on an issue in a custom email template.
I have the following:
<b>Last Comment:<br>
<td><% out << componentManager.commentManager.getComments(issue)?.last()?.body %>
which happily shows the last comment, but fails for issue where there are no comments.
I'm sure there is a way to add an 'If' statement to this to handle the error but can't seem to get it to work... any help greatfully appreciated.