Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
XavierPicquart
Product and Topic Expert
Product and Topic Expert
1,025

The integration of SAP Cloud ALM using mapping capability of External API Management were demonstrated with these blogs:

 

Purpose

An enhancement of the mapping capability has been released. Instead of hard-coding data like user ID, project ID, variables can be declared in the mapping and set in the Subscription. In the payload-based mapping, the variables will be replaced at runtime during the transformation mapping.

 

Prerequisite

You have followed one of the aforementioned blogs and know how to use the External API Management application of SAP Cloud ALM.

In this example, the webhook and mapping of this blog will be reused: SAP Cloud ALM API & Integration: Several extensions of SAP Cloud ALM with SAP BTP (Part 2): Replicat...

 

Procedure

Mapping creation with a user variable

XavierP_0-1707753587429.png

In the SAP Cloud ALM External API Management application, create a mapping. The mapping defines the transformation rule to apply before sending the request and after receiving the response. 

XavierP_0-1707754761296.png

Here the projID variable is used to define the projectID.

At runtime, it will be replaced by the configured value or an empty string if the variable name is not defined in the subscription.

 

{
    "_information":
    {
        "_version": "1",
        "_source": "SAP Cloud ALM Task",
        "_destination": "SAP Cloud ALM Task",
        "_name": "SAP Cloud ALM Task to SAP Cloud ALM Task",
        "_comment": ""
    },
    "structure":
    {
        "request":
        {
               	"externalId": "#{id}",
  				"projectId": "#{@USER_VAR(projId)}",
  				"title": "#{title}",
  				"type": "CALMREQU",
  				"description": "#{description}",
 				"scopeId": "f15896c1-ef45-4e9e-81c9-907c1f6ecaf3"
        },
        "response":
        {
            "externalId": "#{id}"
        }
    },
    "eventTypeMapping":
    {
        "_comment": "Specific event type mapping",
        "operationMappings":
        [
            {
                "eventType": "TASK.CREATED",
                "operation": "POST",
                "responseRoot": "",
                "externalIdProperty": "/id"
            }
        ]
    }
}

 

Check the help.sap.portal for more information.

Subscription creation

Create a subscription based on already created web-hook and mapping.

XavierP_1-1707755086422.png

As soon as a mapping with a user variable is selected, the variable can be defined.

XavierP_2-1707755193432.png

 

More Information

SAP Cloud ALM API Guide

Thanks for reading.