Close a change request using rest API

Jaydeep Yadav
Tera Contributor

Hi Everyone,

 

How to Close a change request using rest API.

Tried PATCH request to  https://XXXXdev.service-now.com/api/sn_chg_rest/change/{sys_id}

and providing close code, close note and state,

close code and notes are updating but the state is not changing to close state.

 

Please help.

 

Regards,

Jaydeep Yadav

7 REPLIES 7

AnveshKumar M
Tera Sage
Tera Sage

Hi @Jaydeep Yadav 

Have you checked the system log for any error or warnings?

Thanks,
Anvesh

Hi @AnveshKumar M  ,

 

Thanks for responding.
No errors/warnings are there in Logs.

 

Regards,
Jaydeep Yadav

@Jaydeep Yadav 

What is the type of change you are trying to close?

 

I tried this using the same PATCH, it worked perfectly.

 

End Point: PATCH https://dev95429.service-now.com/api/sn_chg_rest/change/{sys_id}

Body: {"close_code":"successful","close_notes":"test notes","state":"3"}

 

AnveshKumarM_0-1695886322319.png

 

 

 

Thanks,
Anvesh

Hi @AnveshKumar M ,

 

We are trying to close standard change,

Also, We have made state field as read only, hence rest api is not able to change the states.

 

Regards,

Jaydeep Yadav