We are using Atlassian SDK version 12.1.1 with .NET and are having trouble setting a custom date picker field using the API. We have browsed though the forums but unable to find a working solution. We have tried various date-time formats, but none worked. Please let us know if we are doing anything wrong. We have tried the following variations:
issue["SLA Deadline"] = DateTime.Now.Adddays(5).ToString("dd/MMM/yy h:mm tt");
issue["SLA Deadline"] = DateTime.Now.Adddays(5).ToString("dd/MMM/yy hh:mm tt");
issue["SLA Deadline"] = DateTime.Now.Adddays(5).ToString("o");
issue["SLA Deadline"] = DateTime.Now.Adddays(5).ToString("yyyy-MM-ddTHH:mm:ss.fffzzz");
issue["SLA Deadline"] = DateTime.Now.Adddays(5).ToString();
In all cases, we receive the following error message:
InvalidOperationException: Response Status Code: 400. Response Content: {"errorMessages":[],"errors":{"customfield_14952":"Error parsing time: 2020-08-01T08:40:49.874-07:00"}}
Note: The message "Error parsing time: <datetime>" varies depending on the format used.
The field 'SLA Deadline' is a date-time picker field and woks fine from the UI. The actual format expected by the field, when using the UI, is: dd/MMM/yy h:mm a
Any help appreciated.