I'm building a fairly simple REST app for ServiceNow. Using the REST API Explorer (great tool!) and some examples on here I've been able to connect and raise Incident records with all the field information I need.
The only thing I can't seem to wrap my head around is how to pick up the text label of an Incident State - I can get the integer from the Incident record and I understand there is a relationship set up within the Dictionary between each integer and a corresponding label. Eg. Incident State=1, Label is "New"
Maybe I'm wrong, but I would expect I can look up another table via REST, pull out the integers and retrieve my text statuses? I've tried accessing the Dictionary table in the API explorer but this doesn't go far enough...any help out there please?
My goal for this integration is to raise an incident or request, and then when required report back the status of said record - been doing my head in for days...
What you're looking for is a display value.
You can set a query parameter using REST API Explorer named sysparm_display_value
.
Value options are:
From the wiki: here
Using the value all, this is what the payload returns for incident_state
:
"incident_state": { "display_value": "On Hold", "value": "3" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With