<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719767#M376693</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
    <pubDate>Sun, 15 Nov 2020 14:06:39 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2020-11-15T14:06:39Z</dc:date>
    <item>
      <title>Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719763#M376689</link>
      <description>&lt;P&gt;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.&amp;nbsp; I've tried all the following approaches and none of them work. Any suggestions would be very much appreciated.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I'm using this method: &lt;A href="https://developer.servicenow.com/dev.do#!/reference/api/paris/rest/change-management-api#change-PATCH-standard"&gt;PATCH /sn_chg_rest/&lt;WBR /&gt;change/&lt;WBR /&gt;standard/&lt;WBR /&gt;{sys_id}&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;I verified that my Standard change template does not have "state" as read-only.&amp;nbsp;Here is the list of read-only fields when I run&amp;nbsp;StdChangeUtils().getReadOnlyFields() method: "description,backout_plan,short_description,implementation_plan,test_plan,justification,category,business_service,parent"&lt;/LI&gt;
&lt;LI&gt;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 &lt;A href="https://hi.service-now.com/kb_view.do?sysparm_article=KB0816149"&gt;HI KB post &lt;/A&gt;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.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;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.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;I've ensured that &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;all required fields are populated&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;with data values before attempting to change the state. That doesn't solve it either.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;I've reviewed the business rules, workflows and Flow Designer objects to look for any running processes that would&amp;nbsp;abort the attempted update and found nothing.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;I've tried updating a different field (e.g., assigned_to and that works). But "state" does not work.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/201703iC55ADC386A79F68E/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/201697i8679C25D0E5BD7DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 17:32:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719763#M376689</guid>
      <dc:creator>Todd O</dc:creator>
      <dc:date>2020-11-13T17:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719764#M376690</link>
      <description>&lt;P&gt;Looks like you're just querying for the record, not setting any values. Under Request Body, do you have state, -2 set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/201695iFDD606BB2649F23F/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:45:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719764#M376690</guid>
      <dc:creator>Michael Fry1</dc:creator>
      <dc:date>2020-11-13T18:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719765#M376691</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="1d629669dbd81fc09c9ffb651f961916"&gt;@Michael Fry&lt;/SN-MENTION&gt;&amp;nbsp;yes, per my original post (#3) I've tried it using both the request body (as you suggest) as well as the query parameters. If you read the SN documentation, it indicates you can use either - thus reason why I've tried both.&amp;nbsp; In fact, SN docs say that Query params will override the request body - but again either of them&amp;nbsp;are supposed to work. I'm still hoping I get some more input on some things I haven't tried. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:56:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719765#M376691</guid>
      <dc:creator>Todd O</dc:creator>
      <dc:date>2020-11-13T18:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719766#M376692</link>
      <description>&lt;P&gt;Here are a few more tidbits about my scenario.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;If I try this same scenario in my PDI, it works as expected. Therefore, there must be some behavior in our QA instance that is aborting the update for some reason.&lt;/LI&gt;
&lt;LI&gt;I've reviewed BRs and logs and cannot find any indication as to why this update request is being rejected.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;As a reminder, I've already tried the request using the request body vs query parameters. Neither scenario is working as expected.&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 13:58:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719766#M376692</guid>
      <dc:creator>Todd O</dc:creator>
      <dc:date>2020-11-15T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719767#M376693</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 14:06:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719767#M376693</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-11-15T14:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719768#M376694</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="19525629dbd81fc09c9ffb651f961989"&gt;@Ankur Bawiskar&lt;/SN-MENTION&gt;&amp;nbsp;you have found it the root cause for me! See the side by side image below. The left side shows my instance where everything works as expected. The right side shows our QA image where I'm having this problem. Notice there is a dictionary override where the "Override read only" field is set to "true" in the instance where the problem exists. Also, I see there is a person's name in the "Updated by" column which tells me it was changed from out of the box. I updated this back to out of box "false" value and it's now working!!!&lt;/P&gt;
&lt;P&gt;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 &lt;A href="https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/data-dictionary-tables/task/t_DefineADictionaryOverride.html"&gt;SN documentation&lt;/A&gt; it does the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color: #800000; color: #ffffff;"&gt;Select the check box to display the&amp;nbsp;&lt;SPAN class="ph uicontrol"&gt;Read only&lt;/SPAN&gt;&amp;nbsp;field, which overrides whether a user can change the field value on the extended table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="background-color: #ffff00;"&gt;Do you have some additional&amp;nbsp;explanation&amp;nbsp;on what this read-only set to true means?&lt;/SPAN&gt; 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!!!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/201698i94900B5BAA955072/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="background-color: #800000; color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 14:42:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719768#M376694</guid>
      <dc:creator>Todd O</dc:creator>
      <dc:date>2020-11-15T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719769#M376695</link>
      <description>&lt;P&gt;Glad to help.&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/data-dictionary-tables/task/t_DefineADictionaryOverride.html" target="_blank"&gt;Define a dictionary override&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Out of the box state field is editable on CHG table.&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Ankur&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 15:30:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719769#M376695</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-11-15T15:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719770#M376696</link>
      <description>&lt;P&gt;Thanks again &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="19525629dbd81fc09c9ffb651f961989"&gt;@Ankur Bawiskar!&lt;/SN-MENTION&gt;&amp;nbsp;That makes sense and now I can see the behavior on the form that this setting either makes the field read only&amp;nbsp;or not depending on whether it's checked.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 16:02:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/1719770#M376696</guid>
      <dc:creator>Todd O</dc:creator>
      <dc:date>2020-11-15T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2590308#M1007810</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;, Can you please help me to get working curl for&amp;nbsp;/sn_chg_rest/change/standard/{standard_change_template_id} API . I need to create a standard change request using a API&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 11:05:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2590308#M1007810</guid>
      <dc:creator>Ankit Rastogi</dc:creator>
      <dc:date>2023-06-16T11:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2590317#M1007814</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/86934"&gt;@Ankit Rastogi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can check the curl script when you use rest api explorer&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 11:13:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2590317#M1007814</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2023-06-16T11:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is state value not persisting with RESt API sn_chg_rest/change/standard request</title>
      <link>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2591034#M1008098</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;Where can I check this? It would be great if you could help me with working curl which I can try at my instance.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 11:42:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/why-is-state-value-not-persisting-with-rest-api-sn-chg-rest/m-p/2591034#M1008098</guid>
      <dc:creator>Ankit Rastogi</dc:creator>
      <dc:date>2023-06-17T11:42:29Z</dc:date>
    </item>
  </channel>
</rss>

