The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Beautify JSON via API incident update

Benedikt Kaiser
Tera Contributor

Hi,

 

in ServiceNOW I'm updating the work-note in an incident via the API.

I'm sending a JSON object which looks like this:

{
	"Requestor": "Testi Test",
	"0": {
		"requestId": "12345678910",
		"scriptOutput": "",
		"Action": "Status",
		"SvcName": "test",
		"ServiceInstalled": "True",
		"SvcStatus": "Running",
		"Result": "Success"
	},
	"1": {
		"Action": "Status",
		"SvcName": "server",
		"ServiceInstalled": "False",
		"SvcStatus": "NULL",
		"Result": "Service Not Installed."
	},
	"2": {
		"Task FAILED": "test failure",
		"CODE": "FAIL",
		"ACTION": "Dispatch Ticket To L2"
	}
}

 

However, in the ticket it is not shown as a JSON object but is compressed:

BenediktKaiser_0-1694595437178.png

 

Can I somehow beautify the shown comment in ServiceNOW with the API call?

 

Thanks in advance and best regards,

Benedikt 

0 REPLIES 0