Trying to change State via API

bea
Kilo Explorer

Hi all!

I'm working with an integration acct that is creating/updating Incident tickets in ServiceNOW and am struggling with the ability to update State specifically. My implementation has some customizations including renaming of some fields, so we call State = 1 "Opened" (not new), and it is the state that a ticket is in prior to being assigned to a technician.

I'm having an issue that when I try and transfer a ticket via REST to another team and set the assigned_to value to null, the State value stays "2" (i.e. in progress).

Is State meant to be an editable / overridable field via API? Even when I explicitly define state = "1" in my call, it will not override to Open.

9 REPLIES 9

dave_slusher
ServiceNow Employee
ServiceNow Employee

These things are hard to debug remotely. Actually, impossible. That said, here's a few things to tackle.



1) Can you impersonate as the API user (or user with identical roles/groups)   then try to do that edit via the UI? Might expose some ACL problems which seems like you already suspect.



2) Double check that some business rule is not changing the value out from under you.



3) Double check your ACLs. A baseline instance shouldn't have anything that is doing this, but someone might have modified something.



4) Double check that you are passing in the exact value (not name) via the integration. Check for some sort of weird coercion in integration code if that is possible. If you are passing a value that doesn't exist, that will just get ignored.



Let me know if any of this helps.


Hi Dave,



Thank you for your response! Unfortunately I'm not the admin in this implementation, just a developer trying to utilize an integration acct, so some of your troubleshooting steps are out of reach for me - but I can liaison with the admin on my end and see if we can tackle it together. Appreciate the places to start.



I have checked that I'm passing an exact value.


darius_koohmare
ServiceNow Employee
ServiceNow Employee

Dave's tips are on point for troubleshooting.



Are you familiar with the REST API Explorer?


This is a great way to validate your syntax by building the query you desire in the explorer, then generating the code snippet.


REST API Explorer - YouTube


Hi Darius,



Thanks, I am familiar - unfortunately don't have access to REST API Explorer in the implementation that I'm trying to work with. What I can do though is use my developer instance to try and build it out. Thanks!