Hello,
I am creating a post function that would record the date/time of a transition into the "Dev Done Test" field (if it's empty). I am trying to write a script that would do exactly that, but with no luck.
-------------------------------------------------------
import com.atlassian.jira.component.ComponentAccessor;
import java.sql.Timestamp;
import com.atlassian.jira.issue.Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjects(issue).find { it.name == "Dev Done Test" }
def cfValues = issue.getCustomFieldValue(cf)
def dateCf = customFieldManager.getCustomFieldObject("customfield_13300") // Date time fields require a Timestamp
if (cfValues['dateCf'] == null) {
issue.setCustomFieldValue(dateCf, new Timestamp((new Date()).time))
}
-------------------------------------------------------
Could you tell me what am I doing wrong, please?