I thought this would be simple, but a custom fields value will not display in the template.
I've attempted:
$issue.getCustomFieldValue('customfield_###)
#set( $test = $customFieldManager.getCustomFieldObject("customfield_###"))
#if($issue.getCustomFieldValue($test))
$stringUtils.leftPad($test.name, $padSize): $issue.getCustomFieldValue($test)
#end
with no luck. I've reviewed https://docs.atlassian.com/software/jira/docs/api/8.5.4/ but am still not able to render the custom field value. The custom field itself displays all the project roles of a project, so it's always populated.
Hi Raynard,
For custom fields with simple string values, something like this should render:
$issue.getCustomFieldValue('customfield_10200')
or
#set($cf = $customFieldManager.getCustomFieldObject('customfield_10200'))
$cf.getValue($issue)
Please ensure that the custom field ID in your template is correct. Also, if you are using this template in an issue workflow post-function, make sure that the notification post-function is ordered to fire after re-indexing has occurred.
You can break your template down in order to debug it:
#set ($cfId = 'customfield_10200')
#set($cf = $customFieldManager.getCustomFieldObject($cfId))
#if ($cf)
Found custom field $cf.getName()
#set ($cfVal = $cf.getValue($issue))
#if ($cfVal)
It has value: $cfVal
#else
It has no value
#end
#else
No custom field found for ID: $cfId
#end
We make picking custom fields in templates super easy in Notification Assistant for Jira you can see an example at https://atlasauthority.atlassian.net/wiki/spaces/NAFJ/pages/1344667725/Create+Email+Template
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.