I am trying to clear a custom date field in a post function. The code I use works in the Console, but not in as a Post Function.
The basic code is:
def dateCf = customFieldManager.getCustomFieldObject(10900)
issue.setCustomFieldValue(dateCf, null)
Which when run as a Post Function returns an error: "Source GenericValue can not be null." But works fine in the console as long as I define and set the issue.
Also, the dates are actually cleared out, so the script is functional even though errors are returned.
Any ideas?