This page describes common use cases for ServiceNow integration.

Use case 1

Problem: Incidents need to be dynamically routed from OpsRamp to ServiceNow based on resource-level custom attribute values used in alert escalation policies. OpsRamp must populate the ServiceNow assignment (assignee) group dynamically using the value of a custom attribute defined on the resource. When this custom attribute is not present or is null, OpsRamp must still route the incident to a default assignee group, without requiring any post‑processing, scripting, or routing logic on the ServiceNow side.

Solution:

  • When a custom attribute with value is added to a resource, ServiceNow integration substitutes with this attribute and value and passes on to the outbound payload.
  • When a custom attribute is not added to a resource, ServiceNow integration substitutes with the default value specified in the Outbound integration payload which will pass on to the incident ticket to ServiceNow.

You can use the below code snippet in ServiceNow Integration Outbound in Create/Update events payload:

  "resource_customAttribute":"#if($utils.customAttributeValue($incident.resources,"aks-managed-azure-cni-overlay") != ''&&
   $utils.customAttributeValue($incident.resources,"testingResourcecustom1"))$utils.customAttributeValue($incident.resources,"aks-managed-azure-cni-overlay")#{else}Medium#end"

ServiceNow > Outbound > Event > Payload:

Custom Attributes - Outbound