Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help setting date-picker field using Atlassian SDK .NET C#

Siva Arun
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 30, 2020

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.

0 answers

Suggest an answer

Log in or Sign up to answer