cancel
Showing results for 
Search instead for 
Did you mean: 

Integrate an external task system to Cloud ALM.

Archana_12
Explorer
0 Kudos

Hi Community Members,

I am trying to integrate an external system(Rev-Trac) to Cloud ALM. I am trying to create a request in Rev-Trac whenever a requirement is created in Cloud ALM. I have set up a subscription, webhooks and mapping in Cloud ALM but I somehow keep getting a 502 BAD_GATEWAY error from External API management console in Cloud ALM.

here is my configuration:
Subscription:

Archana_12_0-1713404057313.png

WebHook:

Archana_12_1-1713404084369.png

Mapping:

Archana_12_2-1713404107980.png

Example mapping:

{
"_information": {
"_version": "1",
"_source": "SAP Cloud ALM",
"_destination": "RevTrac_Dingo",
"_name": "SAP Cloud ALM Task to Rev-Trac Dingo",
"_comment": ""
},
"structure": {
"request": {
"fields": {
"summary": "#{title}",
"issuetype": {
"name": "Task"
},
"project": {
"key": "#{@USER_VAR(projectId)}"
},
"labels": [
"#{workstream}"
],
"assignee": {
"accountId": "632adf49234d44d406cf77bb"
}
}
},
"response": {
"displayUrl": "#{self}",
"externalNumber": "#{key}",
"externalId": "#{id}"
}
},
"eventTypeMapping": {
"_comment": "Specific event type mapping",
"operationMappings": [{
"eventType": "TASK.CREATED",
"operation": "POST",
"responseRoot": "",
"externalIdProperty": "/id"
},
{
"eventType": "TASK.UPDATED",
"operation": "PUT",
"responseRoot": "",
"path": "/#{@CLOUD_ALM_EXTERNAL_ID}",
"structure": {
"request":
{
"fields":
{
"description":
{
"type": "doc",
"version": 1,
"content":
[{
"type": "paragraph",
"content":
[{
"text": "Project ID: #{projectId}\n\nStatus: #{status} \n\n#{description} updated",
"type": "text"
}]
}]
}
}
},
"response": {
"ticketUpdated": true
}
}
},
{
"eventType": "TASK.PING",
"operation": "GET",
"responseRoot": "",
"path": "/#{externalId}",
"structure": {
"response": {
"displayUrl": "#{self}",
"externalNumber": "#{key}",
"externalId": "#{id}",
"externalStatus": "#{fields.status.name}",
"lastUpdatedAt": "#{fields.updated}",
"createdAt": "#{fields.created}",
"lastUpdatedBy": "",
"createdBy": "#{fields.creator.displayName}",
"assignedTo": "#{fields.assignee.displayName}"
}
}
},
{
"eventType": "TASK.DELETED",
"operation": "DELETE",
"responseRoot": "",
"path": "/#{@CLOUD_ALM_EXTERNAL_ID}"
}]
}
}

here is the error in the console:

 

Archana_12_4-1713404237949.png

This mapping was an example and I think the problem lies here. Any help is highly appreciated.

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Sophie_V
Advisor
Advisor
0 Kudos

Hi Archana_12,

The 302 error is returned by the external Rev-Trac service. As a result, the application External API Management is showing a gateway error to reflect that the external call can't be performed. 

The error is probably at webhook level (and most probably in your BTP destination configuration).

Please ensure API calls would work to this particular external API with a proper authentication. Maybe you can check with an API tool like Postman, bruno or Insomnia. 

The test payload you are sending is supposed to be for a Jira system. Once the service is reachable, you might get a 4xx error but first, you would need to make the API reachable. 

Best regards,
Sophie

Archana_12
Explorer
0 Kudos

Hi Sophie, thanks for your response. I have tried using the same payload from the console and called Rev-Trac listener through postman and it works. I am not sure where I am going wrong with BTP. I have set the destination URL as the listener URL with the API Token at the end. The authentication used is "No Authentication" as I couldn't find any option to set the authentication as "API Token".

Sophie_V
Advisor
Advisor

Hi Archana_12,

Do you use a similar URL in Postman?

To add a custom header in a BTP destination, you would need to use the following syntax in "Additional Properties":
URL.headers.(yourHeaderName) as key and your header value. 
You should use this method to provide the API token. 

Best regards,
Sophie

Archana_12
Explorer
0 Kudos

Hi Sophie, I tried to add the header and add API key through that. The error has changed now.

Archana_12_0-1713834794728.png

Thanks for your help. Looks like it is reaching the external system now. Do you have any suggestions for the payload? Any help is appreciated. 

 

 

Archana_12
Explorer
Hi Sophie, I changed the mappings to reflect what the external system is expecting, and I am now able to create a request from a requirement. Thanks for all the help! Much apreciated.

Answers (0)