I want to update the date of DAT TIME custom field-
String newTransferDate = formatDate.format(Calendar.getInstance().getTime());//must be of this format yyyy-mm-dd hh:mm:ss
//update the IPCompliance Transfer Time custom field.
Object newValue = null;
newValue = (Object) newTransferDate
I use the following API to update the "DATE TIME" custom field
Object customFieldOldValue = exportedCheckCustomField.getValue(currentIssue);
ModifiedValue modifiedValue = new ModifiedValue(customFieldOldValue, newValue);
FieldLayoutItem customFieldLayoutItem = ComponentManager.getInstance().getFieldLayoutManager().getFieldLayout(currentIssue)
.getFieldLayoutItem(exportedCheckCustomField);
exportedCheckCustomField.updateValue(customFieldLayoutItem, currentMutableIssue, modifiedValue, new DefaultIssueChangeHolder());
The updateValue method throws the below exception-
----------------------------------------------------------------------------------------------------------------------------------
class com.atlassian.jira.issue.customfields.impl.DateTimeCFType passed an invalid value of type: class java.lang.String
dLocalContainer] java.lang.ClassCastException: class com.atlassian.jira.issue.customfields.impl.DateTimeCFType passed an invalid value of type: class java.lang.String
dLocalContainer] at com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType.assertObjectImplementsType(AbstractCustomFieldType.java:111)
dLocalContainer] at com.atlassian.jira.issue.customfields.impl.DateTimeCFType.getStringFromSingularObject(DateTimeCFType.java:56)
dLocalContainer] at com.atlassian.jira.issu