CXone Webhook - ServiceNow Incident Updates

Hey all,

So we’ve got this weird one happening with the ServiceNow webhook pipeline - updates to existing incidents are dropping fields. It’s not consistent, which is making it… fun (400). It’s only updates, initial incident creation works fine.

The flow is pretty standard. CXone event (Interaction event - wrap up complete) → Data Action (HTTP POST to ServiceNow) → ServiceNow incident update. We’re using the standard ServiceNow Table API endpoint for incidents. OAuth 2.0, obviously.

Here’s how I’m picturing it, visually:

+-------------+ +-----------------+ +---------------------+
| CXone Event | ---> | Data Action (POST) | ---> | ServiceNow Incident |
+-------------+ +-----------------+ +---------------------+
 (Wrap Up) (HTTP Request) (Update/Create)

The payload we’re sending looks something like this - it’s a JSON string:

{
 "number": "INC0012345",
 "work_notes": "Updated from CXone",
 "comments": "Interaction details here",
 "state": "3",
 "short_description": "Call wrapped up",
 "caller_id": "1234567890"
}

We’ve checked the field mappings in the Data Action a million times. It’s not an issue with the mappings themselves - sometimes all fields get updated, sometimes work_notes and comments are just… gone. No error in the CXone Data Action logs. The ServiceNow logs are spitting out a 400 (400) - invalid_request with a message like “Missing required fields”.

Here’s a snippet from the ServiceNow REST API logs:

2024-05-03 14:32:00 - INFO - Incoming request: POST /api/now/table/incident
2024-05-03 14:32:00 - ERROR - Mandatory field missing: short_description
2024-05-03 14:32:00 - ERROR - Response Code: 400

Which is… misleading. short_description is in the payload. Took like 3 hrs to find that out.

We’re using the latest CXone Spring '24 release. SDK version’s up-to-date. We’ve tried throttling the requests (maybe ServiceNow is getting overwhelmed?) but no change. We’re seeing this happening across multiple queues and agents.

Anyone else run into this? Seems like there’s a race condition somewhere, or maybe CXone is sending truncated payloads sometimes. ymmv.

Cause: The intermittent field loss suggests the Data Action’s payload isn’t consistently structured - it’s likely a serialization issue (400). ServiceNow expects a specific JSON format. Why would the payload change between requests? It doesn’t make sense.

Solution: Explicitly define the JSON payload within the Data Action configuration using a template. Avoid relying on dynamic variable substitution where possible. A Terraform module can enforce this.

resource "genesys_cloud_data_action" "example" {
 name = "ServiceNow Incident Update"
 action_type = "HTTP_POST"
 url = "https://<instance>.service-now.com/api/now/table/incident"
 template = <<EOF
{
 "number": "{{incidentNumber}}",
 "short_description": "{{shortDescription}}",
 "state": "6"
}
EOF
}

For what it’s worth, the state field is an integer representing the incident state in ServiceNow. Verify that value is correct (422).

2 Likes

that serialization fix worked (200). cleaned up the JSON in the Data Action and the fields are sticking now.