Change Control API - Planned Date\Time

Attempting to build Change Controls via the API. In the GUI, if you choose the same date, it adds 15 minutes, so you could do a start 1/11/2023 14:00:00 and an end of 1/11/2023 14:15:00. When I attempt to what appears to be anything less than the next day, the API validation fails with the following error:

     | {"code":"planning_end_time_greater","message":"Planning_End_Date_Time should be greater than
     | Planning_Start_Date_Time"}

It’s also converting the time from local to UTC. The validation only appears to be successful if it’s over the next day using the UTC date\time in the validation. Can someone confirm the validation rules and provide guidance?

Hi @rasimm

Kindly refer Schema doc for Freshservice for understanding usage of date format. Further refer the create change example to see the usage as depicted below

{
     ...
    "planned_start_date": "2019-03-20T16:18:46Z", 
    "planned_end_date": "2019-03-23T16:18:46Z",
     ...
}

Regards,
Thakur

1 Like

Thank you @Thakur_Ganeshsingh. We had tried a couple of date formats such as:

2023-01-17T12:57:38.1663265-05:00

According to the schema in the docs, it doesn’t support the time zone (e.g. -05:00), so the assumption is this was being stripped or concatenated and causing the behavior. To remediate, the date is converted from local to UTC prior to sending to the API and it appears to work properly.