Hey,
I've been looking around but I can't get waht I want. I want a custom field (number field) shown in my email subject.
According to those posts:
https://confluence.atlassian.com/display/JIRA/Customising+Email+Content
https://developer.atlassian.com/display/JIRADEV/Adding%20Custom%20Fields%20to%20Email
https://answers.atlassian.com/questions/115392/jira-email-notification-subject-adjustments
https://answers.atlassian.com/questions/69875/adding-a-custom-field-to-the-automated-jira-generated-email
I have edited the issuecreated.vm in the subject folder. That's what I have:
($issue.key) $issue.getCustomFieldValue("customfield_12562") $issue.summary
Watching the mail queue it seems like it should be working (cf is shown) but the logs show me the following error:
2013-05-14 12:57:07,764 http-8090-6 WARN CzaiaC 777x546x1 zs956v 10.250.205.193 /secure/admin/MailQueueAdmin!default.jspa [velocity] org.apache.velocity.runtime.exception.ReferenceException: reference : template = getEncodedBodyFromContent [line 1,column 14] : $issue.getCustomFieldValue("customfield_12562") is not a valid reference. at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:277)
Any ideas?
Hi,
Use as below
#set($cField=$customFieldManager.getCustomFieldObject("customfield_12562"))
$issue.getCustomFieldValue($cField)
I'll try it.
Strange... The subject seems to be correct if you look at the mail queue but as soon as the mail gets sent, the subject is empty (apart from the configured prefix)
Are you still having the issues, even after using the above code.
Also in the error list which you have shared it states that $issue.getCustomFieldValue("customfield_12562") is not a valid reference.
Because issue.getCustomFieldValue(X), will take customfield & since you were not passing the Customfield you were getting error.
Also please check if the value returned is not null before using it in summary
It looks like you're new here. Sign in or register to get started.