Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Schedule entry - start , end date time & all day check box not updated via rest api

MihirV
Tera Contributor

I am trying to create schedule entry for a user via rest api ( example HR app passing time off for user). Even though rest request is sucessfull and record is created start date time , end date time & all day check box are not getting created in Servicenow. Start/End date time remains blank & all day check box remains default false. ACLs are already created to update via rest services.

Here is json 

POST - {instance} /api/now/table/cmn_schedule_span?sysparm_display_value=true

 

{"schedule":"a5a77fec93f4b2106b36fc2fdd03d65f",
"name":"HR time off",
"type":"Time off",
"show_as":"Busy",
"start_date_time":"2025-11-02 00:00",
"end_date_time":"2025-11-02 23:59"
"all_day": true
}
 
Response still indicate - 
        "start_date_time": "",
        "end_date_time": "",
        "all_day": "false",
 

 

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hi,

The start date time, and end date time fields expect the values in ISO8601 format, e.g

 

20251103T170000

for

Year 2025

Month 11

Date 03

Hour 17

Minute 00

Second 00

 

View solution in original post

2 REPLIES 2

Kieran Anson
Kilo Patron

Hi,

The start date time, and end date time fields expect the values in ISO8601 format, e.g

 

20251103T170000

for

Year 2025

Month 11

Date 03

Hour 17

Minute 00

Second 00

 

Thanks Kieran '20251103T170000' this format worked. Any idea about 'All day' - ture false flag ?