I'm trying to create a scripted field to show the first time an issue enters a specified Status, in this case "In Progress". Scriptrunner has example code to accomplish this exactly:
package com.onresolve.jira.groovy.test.scriptfields.scripts
import com.atlassian.jira.component.ComponentAccessor
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def created = changeHistoryManager.getChangeItemsForField(issue, "status").find {
it.toString == "In Progress"
}?.getCreated()
def createdTime = created?.getTime()
I've set the template to Date Time, and in the Script field dialogue if I preview an issue key it seems to be returning properly (16/Jan/20 12:03 AM for example), but if I then go look at that same issue directly it just says 'Invalid date'.

What am I missing?