I'm trying to add a custom field value to the create issue HTML email template, but stumbling. The field is required, so there will always be a value present on issue creation.
Attempt 1:
I've followed the directions here: https://developer.atlassian.com/server/jira/platform/adding-custom-fields-to-email/?_ga=2.56485292.608403254.1563807890-1574526416.1556543036
When I add the customerfield.vm as indicated below
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_15707"))
#if($issue.getCustomFieldValue($customfield))
<tr>
<th>#text($customfield.name):</th>
<td class="has-icon">
$textutils.htmlEncode($issue.getCustomFieldValue($customfield), false)
</td>
</tr>
#end
Instead of the comma separated values of the field, I get this message: $textutils.htmlEncode($issue.getCustomFieldValue($customfield), false)
Attempt 2:
I tried the suggestion in another article, but instead of the value, I get the label name a second time.
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_15707"))
#set ($customfieldvalue = $customfield.getValue($issue))
#if($customfieldvalue)
<tr>
<th>#text($customfield.name):</th>
<th>$customfield</th>
</tr>
#end
and tried
#disable_html_escaping()
#set ($customfield = $customFieldManager.getCustomFieldObject("customfield_15707"))
#set ($customfieldvalue = $customfield.getValue($issue))
#if($customfieldvalue)
<tr>
<th>#text($customfield.name):</th>
<th>$customfieldvalue</th>
</tr>
#end
I can't tell if my issue is coming from the createissue.vm or customfield.vm or how to fix it. any help/suggestions would be very much appreciated!
Technically, no, JIRA hides tabs that contain only fields with no data when you're in the issue view.
The best cheat is to simply include a field you know will have data (you'll need a separate one for each tab). If your field list for a tab does not include any mandatory fields, then you could reach for a scripted or message field (I've not tested this trick with the message fields from the JIRA Suite Utilities yet, but I think it still works - I used it to put text on tabs saying simply "the fields for this tab are all empty at present, please edit the issue and fill them in")
i used the Message Custom Field for View from JIRA Toolkit plugin,
How do i hide this field in case any field in a tab is not Empty?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.