What would an example payload for all standard incident fields look like using the REST api?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2019 11:01 AM
My understanding is that ServiceNow fields for a given version can't be removed (though an admin can add fields). That should imply that for all instances of a release that all record operations should have at a minimum the same fields to work with. So, what I have been looking for is an example payload that writes to all fields for tables like incident and problem. I only seem to be able to find overly simplistic PUT examples where only a few fields are written out. Where can I find an example that writes to all possible fields in the incident table using REST?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2019 04:26 PM
Use REST API Explorer in SN and that should like you everything you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2019 01:44 PM
Those links don't address my question.
I have been using the rest api explorer and postman to poke around but the documentation seems quite incomplete. For each common table like problem/incident I was expecting to an example payload for all writable fields with discussion about valid/typical values for each. After much googling, I still can't figure out how to get the rest api to even give me the complete list of fields the UI does. Nor can I find any info on how to handle new record creations via RESt where said fields are links to other tables (AssignedTo is probably a good example). I can guess some of the fields that are auto-populated, but can any of them be overridden?
The best option I have come across so far is to do a GET on a manually entered incident via the jsonV2 api, capture the returned payload, make guesses about what fields are acceptable for a PUT and attempt it. This seems to work fine for fields that are direct members of a table, what am I to do about linked tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2019 01:53 PM
With regards to the reference fields, I know you could for sure send a sys_id for that field in the payload. I am not sure what would happen if you send the display value instead. Have you tried that?
Tim