SAP Alert Notification Service for Cloud Integration with ServiceNow

Estimated read time 7 min read

Introduction:

In this blog post, I will showcase how SAP alert notification service can be used to generate incidents in ServiceNow for iflow execution failure in Cloud Integration.

Configuration in ServiceNow:

Step 1:

Create a user which will be used for integration and assign ‘incident_manager’ role to it.

Navigation path for ServiceNow:

All -> User Administration -> Users

As ‘Internal Integration User’ option is checked it will disable UI login for the created user.

Step 2:

Create a group for supporting incidents related to CPI and add members to that group.

All -> User Administration -> Groups

Configuration in Alert Notification Service:

Step 1:

Create service key for Alert Notification as below.

 

{
“type”: “OAUTH”
}

 

This will generate client Id and client secret along with token URL details as below.

 

{
“url”: “https://clm-sl-ans-live-ans-service-api.cfapps.us10.hana.ondemand.com”,
“oauth_url”: “https://xxx.authentication.us10.hana.ondemand.com/oauth/token?grant_type=client_credentials”,
“client_id”: “xxx”,
“client_secret”: “xxx”
}

 

Step 2:

Create Action for ServiceNow incident as below.

Using field mapping option, provide the desired assignment group for this action. To know the column names of ‘incident’ table, check ‘System Definition’ in ServiceNow.

In advanced action properties, ‘Enabled Delivery Status’ is checked.

Step 3:

Create condition as below for CPI alerts.

Step 4:

Create subscription containing the created action (Step 2) and condition (Step 3).

Step 5:

For delivery status, create two conditions as shown below.

Step 6:

Create action type (for example: email) and subscription for the delivery status.

In this case, payload template of action ‘Email’ is set as {body}.

Configuration in Cloud Integration:

Step 1:

Create credential of type ‘OAuth2 Client Credentials’ for writing alerts to Alert Notification Service. It contains the client id/secret of service key of alert notification.

Step 2:

Create credential of type ‘OAuth2 Client Credentials’ named ‘CI_OAUTH_CLNT‘ for accessing message processing log. For this, service key of service ‘SAP Process Integration Runtime’ and plan ‘api’ is used.

Step 3:

Use standard integration package – ‘SAP Cloud Integration with SAP Alert Notification service for SAP BTP’

IFlow – Send notifications for failed Message Processing Logs

Configuration parameters

CI Tenant Base URLUse ‘url’ value of service key of service ‘SAP Process Integration Runtime’ with plan type ‘api’CI Authentication TypeOAuth2ClientCredentialsCI Technical Client NameCI_OAUTH_CLNTService Technical Client NameSERVICE_OAUTH_CLNT [ANS credential of type OAUTH]Service Resource Events URL

{url}/cf/producer/v1/resource-events

Use ‘url’ value of service key of ANS

Source Event ID Strategy

PER_INTEGRATION_FLOW

Outcome:

The incident is created due to Iflow execution failure.

Email body for delivery status as failure :

 

Delivery of event with type ‘CPIIntegrationFlowExecutionFailure’ failed after 1 unsuccessful attempt(s) through action with name ‘ServiceNow’. For additional information, use the Consumer API (Undelivered events). For details on credential management refer to this link: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/credential-management.

 

TakeAway Points:

Alert notification service natively supports integration with ServiceNow. It makes configuration easier.ANS recognises a sequence of stateful events if these share the same value for the predefined tag ‘ans:sourceEventId’.The ‘Source Event ID Strategy’ in the IFlow is configured with the value ‘PER_INTEGRATION_FLOW’. This ensures that the same ‘ans:sourceEventId’ is generated based on the IFlow, allowing only one incident to be created per IFlow. For subsequent failures within the same IFlow, work notes are added to the existing incident.

How does Source Event ID have always the same value for each IFLOW?

It is the MD5 digest value of the IFlow ID, which is generated using groovy script in the standard IFlow.

Reference Links:

SAP Alert Notification for SAP BTPAutomatic alert remediation with Alert Notification, Automation Pilot and ServiceNowReceive Notifications for Failed SAP Cloud Platform Integration Flows via Any Channel with Alert Notification

Regards,

Priyanka Chakraborti

 

​ Introduction:In this blog post, I will showcase how SAP alert notification service can be used to generate incidents in ServiceNow for iflow execution failure in Cloud Integration.Configuration in ServiceNow:Step 1:Create a user which will be used for integration and assign ‘incident_manager’ role to it.Navigation path for ServiceNow:All -> User Administration -> UsersAs ‘Internal Integration User’ option is checked it will disable UI login for the created user.Step 2:Create a group for supporting incidents related to CPI and add members to that group.All -> User Administration -> GroupsConfiguration in Alert Notification Service:Step 1:Create service key for Alert Notification as below. {
“type”: “OAUTH”
} This will generate client Id and client secret along with token URL details as below. {
“url”: “https://clm-sl-ans-live-ans-service-api.cfapps.us10.hana.ondemand.com”,
“oauth_url”: “https://xxx.authentication.us10.hana.ondemand.com/oauth/token?grant_type=client_credentials”,
“client_id”: “xxx”,
“client_secret”: “xxx”
} Step 2:Create Action for ServiceNow incident as below.Using field mapping option, provide the desired assignment group for this action. To know the column names of ‘incident’ table, check ‘System Definition’ in ServiceNow.In advanced action properties, ‘Enabled Delivery Status’ is checked.Step 3:Create condition as below for CPI alerts.Step 4:Create subscription containing the created action (Step 2) and condition (Step 3).Step 5:For delivery status, create two conditions as shown below.Step 6:Create action type (for example: email) and subscription for the delivery status.In this case, payload template of action ‘Email’ is set as {body}.Configuration in Cloud Integration:Step 1:Create credential of type ‘OAuth2 Client Credentials’ for writing alerts to Alert Notification Service. It contains the client id/secret of service key of alert notification.Step 2:Create credential of type ‘OAuth2 Client Credentials’ named ‘CI_OAUTH_CLNT’ for accessing message processing log. For this, service key of service ‘SAP Process Integration Runtime’ and plan ‘api’ is used.Step 3:Use standard integration package – ‘SAP Cloud Integration with SAP Alert Notification service for SAP BTP’IFlow – Send notifications for failed Message Processing LogsConfiguration parametersCI Tenant Base URLUse ‘url’ value of service key of service ‘SAP Process Integration Runtime’ with plan type ‘api’CI Authentication TypeOAuth2ClientCredentialsCI Technical Client NameCI_OAUTH_CLNTService Technical Client NameSERVICE_OAUTH_CLNT [ANS credential of type OAUTH]Service Resource Events URL{url}/cf/producer/v1/resource-eventsUse ‘url’ value of service key of ANSSource Event ID StrategyPER_INTEGRATION_FLOWOutcome:The incident is created due to Iflow execution failure.Email body for delivery status as failure : Delivery of event with type ‘CPIIntegrationFlowExecutionFailure’ failed after 1 unsuccessful attempt(s) through action with name ‘ServiceNow’. For additional information, use the Consumer API (Undelivered events). For details on credential management refer to this link: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/credential-management. TakeAway Points:Alert notification service natively supports integration with ServiceNow. It makes configuration easier.ANS recognises a sequence of stateful events if these share the same value for the predefined tag ‘ans:sourceEventId’.The ‘Source Event ID Strategy’ in the IFlow is configured with the value ‘PER_INTEGRATION_FLOW’. This ensures that the same ‘ans:sourceEventId’ is generated based on the IFlow, allowing only one incident to be created per IFlow. For subsequent failures within the same IFlow, work notes are added to the existing incident.How does Source Event ID have always the same value for each IFLOW?It is the MD5 digest value of the IFlow ID, which is generated using groovy script in the standard IFlow.Reference Links:SAP Alert Notification for SAP BTPAutomatic alert remediation with Alert Notification, Automation Pilot and ServiceNowReceive Notifications for Failed SAP Cloud Platform Integration Flows via Any Channel with Alert NotificationRegards,Priyanka Chakraborti   Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author