Showing results for 
Show  only  | Search instead for 
Did you mean: 

Logical Operations in Webhook Payload


We can do some logical operations in AppDynamics to match the fields of BMC Truesight in the custom webhook integrations. Is there a way to accomplish this in Dynatrace? Because the moment I start writing some code, I immediately get a syntax error.

I also wonder how can we dive into JSON object of {impactedEntities} to extract only the entity name instead of long explanation in {impactedEntity}, such as "CPU increase at abcHost" ?

Below is the code we're using in AppDynamics integration right now...

"eventSourceHostName": "APMTEST",
"eventSourceIPAddress": "xx.xx.xx.xx",
"eventSourceHostName": "${}",
"eventSourceIPAddress": "",
"attributes": {
"controllerUrl": "${controllerUrl}",
"accountId": "${}",
"accountName": "${}",
"mc_object": "${}",
"mc_object_uri": "${latestEvent.deepLink}",
"mc_parameter": "${}",
"mc_tool": "${}_${latestEvent.severity}",
"mc_smc_alias": "${}",
"mc_service": "${}",
"mc_priority": "PRIORITY_1",
#if(${latestEvent.severity}=="ERROR") ---->> HOW CAN WE WRITE THIS?
"severity": "CRITICAL",
#if(${latestEvent.severity}=="WARN") ---->> HOW CAN WE WRITE THIS?
"severity": "MAJOR",
#if(${latestEvent.severity}=="INFO") ---->> HOW CAN WE WRITE THIS?
"severity": "OK",
"msg": "$!{latestEvent.summaryMessage.replace('<br>',' ').replace('<b>','').replace('</b>','')}",
"mc_long_msg": "$!{latestEvent.eventMessage.replace('<br>',' ').replace('<b>','').replace('</b>','')}"

You cannot write any kind of logic in Webhook payloads.

You can only use existing placeholders that are in documentation above. I think it may be good idea to post new product idea about this feature.