Hi,
I have the following case:
I have configured 6 custom issue types custom issue field. Custom field "System" is present in 3 issue types. This custom issue field I need to add in email html notification.
It's ok when issue screen has this custom field, its added correctly in email.
But in case if custom field is not on screens of issue type, I got this line in email:
System: $issue.getCustomFieldValue("customfield_10204")
I have used: Adding custom fields to email instruction with little changes.
https://developer.atlassian.com/server/jira/platform/adding-custom-fields-to-email/
Bellow here system.vm field description.
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_10204"))
#if($issue.getCustomFieldValue($customfield))
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
<th>$stringUtils.leftPad($issue.getCustomField("customfield_10204").name, $padSize):</th>
<td>$issue.getCustomFieldValue("customfield_10204")</a></td>
</td>
</tr>
#end
As I understood condition line #if($issue.getCustomFieldValue($customfield)) is incorrect ore doesn't work.
What is the better way to fix it?