I thought this would be simple, but a custom fields value will not display in the template.
#set( $test = $customFieldManager.getCustomFieldObject("customfield_###"))
$stringUtils.leftPad($test.name, $padSize): $issue.getCustomFieldValue($test)
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.
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
For custom fields with simple string values, something like this should render:
#set($cf = $customFieldManager.getCustomFieldObject('customfield_10200'))
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))
Found custom field $cf.getName()
#set ($cfVal = $cf.getValue($issue))
It has value: $cfVal
It has no value
No custom field found for ID: $cfId
If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events