Hi,
we tried to use the following code snippet in our email template to get the
old values of a customfield (script listener, send a custom email)
<%
def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field == "Name of custom field"}
if (change) {
out << 'Old: ' + change.oldstring + "\n"
out << 'New: ' + change.newstring
}
%>
But we got an error
groovy.lang.MissingPropertyException: No such property: event for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:61)
at groovy.lang.Binding.getProperty(Binding.java:103)
JIRA version: 6.4.7
ScriptRunner version: 3.1.4
Can you please tell us what we do wrong?
Thank you very much in advance
best regards
Sebastian