
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2020 09:32 AM
I'm using out of the box REST API explorer to simply update a Standard Change record's "state" value from "New (-5)" to "Scheduled (-2)." When I submit the request I get a successful 200 OK response but the change does not happen on the CR. It's like it ignores it. I've tried all the following approaches and none of them work. Any suggestions would be very much appreciated.
- I'm using this method: PATCH /sn_chg_rest/
change/ standard/ {sys_id} - I verified that my Standard change template does not have "state" as read-only. Here is the list of read-only fields when I run StdChangeUtils().getReadOnlyFields() method: "description,backout_plan,short_description,implementation_plan,test_plan,justification,category,business_service,parent"
- When specifying the parameter "state" in the payload, I've tried it as both a query parameter as well as JSON using the body. Neither work. There is a HI KB post that describes that you must use the Label (Scheduled) thus the reason I've tried both "Scheduled" as well as the -2 and "-2" values which is the value for Scheduled. Neither work - fact using the numbers gives an error just as the HI KB post discusses.
- I've ensured that I also called the POST /conflict method as well to prove there is NO scheduling conflict with the CI. That doesn't solve it.
- I've ensured that all required fields are populated with data values before attempting to change the state. That doesn't solve it either.
- I've reviewed the business rules, workflows and Flow Designer objects to look for any running processes that would abort the attempted update and found nothing.
- I've tried updating a different field (e.g., assigned_to and that works). But "state" does not work.
Finally, please see the images below showing the attempt and then results. Again, the question is why is it the state value does not get updated with this REST API call?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2020 06:06 AM
Hi,
Did you check is there any dictionary override for state field on change_request table for read-only which is blocking the update from API?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2020 06:42 AM
I need to better understand what this dictionary override read only field actually means. There must have been a reason this person changed it and I need to follow up with them. According to SN documentation it does the following:
Select the check box to display the Read only field, which overrides whether a user can change the field value on the extended table.
Do you have some additional explanation on what this read-only set to true means? I'm still a bit fuzzy on it. I'm going to mark your answer as correct and thank you very much for your assistance!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2020 07:30 AM
Glad to help.
Since state field is on task table if you wish to extend some functionality such as default value, readonly etc you create dictionary override on the extended table
Out of the box state field is editable on CHG table.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2020 08:02 AM
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 04:05 AM
Hi @Ankur Bawiskar , Can you please help me to get working curl for /sn_chg_rest/change/standard/{standard_change_template_id} API . I need to create a standard change request using a API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 04:13 AM
you can check the curl script when you use rest api explorer
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader