Custom payload in alerts integration
Summarize
Summary of Custom payload in alerts integration
Instance Observer integrations in ServiceNow Zurich release enable customers to define and manage custom JSON request payloads for both ServiceNow and third-party alert integrations. This capability allows inclusion of additional fields, exclusion of unnecessary data, and formatting to meet specific API or business logic requirements. It eliminates the need for complex scripted REST APIs on the customer side by allowing direct customization of notification payloads.
Show less
Key Features
- Default and Custom Payloads: Use the provided default mustache template or customize it by modifying keys and values within the Editor window.
- Live Preview and Validation: The Preview section shows the rendered JSON payload in real time, with syntax errors highlighted and saving disabled until corrected.
- Custom Parameters: Add up to 13 custom parameters within a total payload size of 1 to 20 keys, combining default and custom fields.
- Syntax Guidance: Sample custom parameters are provided for reference to ensure correct templating syntax.
- Third-Party Integration Support: Modify JSON keys and structure to align with external system requirements, enabling seamless integration.
- Actions Available: Revert Changes to undo modifications, Reset to Default to restore the original payload, Syntax Validator to enforce JSON correctness, and Test Integration to send sample notifications for webhook verification.
Practical Benefits for ServiceNow Customers
By customizing alert payloads directly within Instance Observer, customers can tailor notifications precisely to the needs of their internal processes or third-party systems without additional development overhead. This flexibility ensures alerts contain relevant data in the correct format, improving integration reliability and reducing maintenance complexity. Validation features help maintain data integrity, and testing capabilities facilitate quick verification of integration configurations.
Instance Observer integrations enable you to define and manage custom JSON request payload for ServiceNow and third-party integrations.
You can now include additional fields in notification payloads, exclude specific data that is not required by the target system, format the payload to align with specific third-party API requirements or internal business logic, eliminating the need for complex scripted REST APIs on the customer side.
- Use either the default payload or customize it to include additional data as needed.
- Modify the default payload, if needed, which is displayed in the Editor window on the left.
- Modify either the key or the value, or both as each parameter consists of a key and a value.
- The Preview section on the right displays the expected JSON payload after rendering.
- If the JSON is invalid, errors are highlighted, and the option to save is disabled.
Default mustache payload template
{
"alert_number": "{{alert_number}}",
"alert_type": "{{alert_type}}",
"alert_name": "{{alert_name}}",
"alert_time": "{{alert_time}}",
"instance": "{{instance}}",
"description": "{{description}}",
"alert_created": "{{alert_created}}"
}
Example: Default Payload + Custom Parameters
{
"alert_number": "{{alert_number}}",
"alert_type": "{{alert_type}}",
"alert_name": "{{alert_name}}",
"alert_time": "{{alert_time}}",
"instance": "{{instance}}",
"description": "{{description}}",
"alert_created": "{{alert_created}}",
"Custom_message": "{{alert_name}}' of type {{alert_type}} generated for {{instance}} at {{alert_time}}. Please review.",
"Severity": “High”
}
Custom parameters and limits
The custom_parameter field allows you to insert custom message into the JSON template, you can also use the existing parameters as shown in the custom parameter samples.
- Required: At least one and at most 20 parameters to save the template.
- Maximum: 13 custom parameters.
- If exceeded, a warning appears: Template must have at least one default key and up to 20 keys. Adjust or select 'Reset to Default' to apply defaults.
Samples of custom parameters for syntax reference
"Information": "An alert {{alert_name}} has been triggered for {{instance}} at {{alert_time}} Description: {{description}}"
"Alert_message": "New alert '{{alert_name}}' of type {{alert_type}} generated for {{instance}} at {{alert_time}}. Please review."
"Event_type": "Severity-High! An alert {{alert_name}} has been triggered for {{instance}} at {{alert_time}} Description: {{description}}"
Third-party request body mapping
Some third-party integrations require specific key names. You can modify the default payload to match their expected format.
{
"endTime": 1,
"entitySelector": "string",
"eventType": "AVAILABILITY_EVENT",
"properties": {},
"startTime": 1,
"timeout": 1,
"title": "string"
}
Modified IO payload to match third-party format
Actions and validation
- Revert Changes
- Restores the last saved content.
- Reset to Default
- Resets the template to its default payload.
- Syntax Validator
- Ensures JSON validity before saving. Errors prevent saving.
- Test Integration
- Sends a sample notification to verify webhook integration.