This is a follow up to:
So in the above it looks like you can build/forward the new event with eventProperties from the old event
// Prepare the HTTP request
var request = http.request({
'endpoint': 'xMatters',
'method': 'POST',
'path': '/reapi/2015-04-01/forms/c34c75ba-379f-4d58-99b4-02154cc8fb79/triggers',
'headers': {
'Content-Type': 'application/json'
}
});
// Where the 'path' is the form uuid destination for the new event
// Prepare the HTTP request body
var json = {
"recipients": recipients,
"Message": callback.eventProperties.Message,
};
// Where recipients is set to the new group and Message is also included in the form
// Submit the request and capture the response
var response = request.write(json);
The problem is then that the "Message" part of the payload gets rejected with "DATA_FORMAT_ERROR", that includes a list of allowed properties/fields
Removing "Message" works fine, but now we can't forward information from the original notification.
Comments
Please sign in to leave a comment.
Hi Kirk!
What you need to do is create a JSON array called properties, instead of "Message".
So the step would look more like this...
And, probably more succinctly, you could probably refer directly to callback.eventProperties...
Anyway, give those a try and let us know!
Hi Jordon,
Pretty good though I used
Great Kirk! Now, if I could just learn how to make my posts look like yours :)
@jordan, hit the paragraph icon and you'll see the different formatting options. I find the best thing to do is write on a separate line "CODEHERE", then put a few blank lines after it. Then select your CODEHERE text and apply the "code" format. THEN paste the code over the CODEHERE placeholder. Doing it any other way gives me headaches.
Thanks @Travis!