Beautify JSON Object in Incident via API
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 05:31 AM
Hi colleagues,
I have a small problem with the ServiceNOW API.
I'm updating the work_notes in an Incident with the following JSON:
[
{
"requestId": "12345678910",
"scriptOutput": "",
"Action": "Status",
"SvcName": "test",
"ServiceInstalled": "True",
"SvcStatus": "Running",
"Result": "Success"
},
{
"Action": "Status",
"SvcName": "server",
"ServiceInstalled": "False",
"SvcStatus": "NULL",
"Result": "Service Not Installed."
},
{
"Task FAILED": "test failure",
"CODE": "FAIL",
"ACTION": "Dispatch Ticket To L2"
}
]
When I update the Incident ticket the work_notes look like this:
Is there any way to format the work_notes in a beautify format?
thanks in advanced,
Benedikt
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 02:32 PM
Hi, using a scripted rest api or transform\import process rather than posting your data directly to the target table would be my recommendation, otherwise you could use a BR on your target table to reformat the work_notes before the record is inserted.