I have created a Post Function which sends a custom email on transition of a workflow state. The email format is of type HTML and hence am sending the details using HTML tags.
If I want to include the system fields I use - <td>${issue.priority.name}</td> and the value of Priority fields gets fetched and displayed into my email template. But when I use the same(for eg., <td>${issue.priority.tool}</td> as tool is a custom field) to get the value of a custom field it doesn't work.
I referred - https://answers.atlassian.com/questions/12161743 and tried - <td>${issue.getCustomFieldValue("customfield_10401")}</td> I get the following error -
ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: TEST-117,
actionId: 11, file: null
groovy.lang.MissingMethodException:
No signature of method: com.atlassian.jira.issue.IssueImpl.getCustomFieldValue()
is applicable for argument types: (java.lang.String) values: [customfield_10401]
Possible solutions: getCustomFieldValue(com.atlassian.jira.issue.fields.CustomField),
setCustomFieldValue(com.atlassian.jira.issue.fields.CustomField, java.lang.Object)
Please help. Thanks.