2 weeks ago
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:
WebHook:
Mapping:
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:
This mapping was an example and I think the problem lies here. Any help is highly appreciated.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
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
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.