AppDynamics Inbound IB Webhook

Not Yet Reviewed

Context

This is an inbound integration script for processing HTTP requests from AppDynamics. The format AppDynamics sends isn't the exact format needed to create an event in xMatters. So this script maps the incoming values to properties for the event, then makes the call to create the event in xMatters. 

Note that the recipient value is hard coded to "AppDynamics", so you'll want to make sure to create some subscriptions. 

Usage

var data;

// If your data is posted as JSON
data = JSON.parse(request.body);
console.log(data);
console.log("ID "+ data.id);

// Parse data from incoming payload and construct the trigger object
trigger.properties.APP_NAME = data.applicationname;
trigger.properties.APP_ID = data.applicationid;
trigger.properties.EN_ID = data.id;
trigger.properties.EN_NAME = data.name;
trigger.properties.SEVERITY = data.severity;
trigger.properties.EN_TIME = data.eventime;
trigger.properties.DEEP_LINK_URL = data.deeplink;
trigger.properties.EVENT_SUMMARY = data.summary;

// Define recipients
var recipients = [];
// Add a recipient targeting a user or group
recipients.push({
'targetName': 'AppDynamics'
});

trigger.recipients = recipients;

// Post trigger to form
form.post(trigger);

0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post