In my ScriptRunner Workflow Post-Function script i'm trying to clear a date field following is the script snippet
currentIssue.update {
if(fieldValue instanceof Date){
setCustomFieldValue(item, null);
}
} Above script return error:
ERROR - Ambiguous method overloading for method com.adaptavist.hapi.cloud.jira.issues.delegates.IssueUpdateDelegate#setCustomFieldValue.
Cannot resolve which method to invoke for [class java.lang.String, null] due to overlapping prototypes between:
[class java.lang.String, class [Ljava.lang.Long;]
[class java.lang.String, class [Ljava.lang.Object;]
[class java.lang.String, class [Ljava.lang.String;]
If I try to set an empty value it gives format error.
The following errors occurred: (customfield_12237=The Target Due Date must be of the format "yyyy-MM-dd")
If I set a null Date object than it gives
ERROR - Cannot get property 'length' on null object
Any hints how to clear a custom field of type date using the ScriptRunner Workflow Post-Function script ?