Forwarding. The new reassigning.

Hey guys! Kevin here with more great tips on using xMatters. 

Have you ever gotten an alert from xMatters and realized it needs to go to someone else? Or maybe you wanted to share the alert with your teammate for further investigating in the morning? In this article we'll build a forwarding workflow using the Events Comments trigger. 

wave_small.png

Here's a peek of what we'll be building:

mceclip4-KP.png

Our flow is kicked off from the Event Comments trigger. That's this guy here:

mceclip2-KPpng.png

  rtfm_small.png

Check out the docs for the Event Comments trigger here

 

He fires when someone adds a comment after selecting any response from an xMatters notification. We'll hook him up to our friend the switch step:

mceclip5-KP.png

Note that we're switching paths based on the Comments.annotation.response.response property coming out of the event comments trigger. I want my flow to only fire when someone responds with "Forward" and they have entered comments, so I continue the flow from the "Forward" nubby into the Get a Group step:

mceclip7.png

This step makes a call into the GET /groups/{groupId} API call to get a single group with the given ID or name. We pass in the annotation.comment property from the Event Comment trigger:

mceclip8-KP.png

The step will output all kinds of cool details about the event:

mceclip9-KP.png

But all we really care about is the statusCode of the HTTP call. As long as the group can be observed by the user responding, then the API will return a 200 OK statusCode. So, we hook up the output of the Get a Group step to another switch step which switches on statusCode:

mceclip11.png

cool_small.png

Here is where things get interesting. I have a Duplicate Alert step and a Reassignment failure. We'll go over the Duplicate Alert step in a moment, but you can see this Reassignment failure step is hooked up to the Default Path. Huh? What's going on there? That is a second form I created to handle all the statusCodes that aren't 200. Like the 404 Not found, which might happen if autocorrect strikes again or your cat sat on your hand at a critical moment.

Anyway, duplicating an alert is actually pretty easy. We know we have all the properties because the trigger of the flow has them already. And the recipients we got from the annotation.comment the user entered, which we know is a group that exists. 

mceclip12-KP.png

So now, when I get the notification:

mceclip13-KP.png

I can also see in the comments in the Tracking Report, who forwarded it, and when:

mceclip15-KP.png

I've attached the Workflow used for this article for reference or duplication, but if you want to add this functionality to your own canvases, you'll need:

 

point_small.png

  1. A new form, maybe call it Reassignment Failure to deal with notifying the responder that there was some failure in targeting the new group. 
  2. A response option on your "main" form. I recommend calling it something like "Forward" so your users know they will need to enter comments to target the group. 
  3. A flow triggered by event comments that contains in this order:
    1. A switch on Comments.annotation.response.response with a path for your Forward response option.
    2. The Get a Group (or if you only want them to forward to people, Get a Person) step. 
    3. Another switch, this one on Get a Group.statusCode with a path for 200. 
    4. A create xMatters event step to duplicate the alert hooked up to the 200.
    5. A create xMatters event step to trigger the Reassignment Failure form hooked up to the Default Path. 

This is a pretty basic workflow, and I can see a couple of additional items that might make it more useful: 

  • Add a check for People as well in case they want to be able to send to a person instead of just a group. 
  • Allow the comment to be in the format <Group> - <message> where "message" is a note to be included to the next recipient.

 If you're up for a challenge, try it out and drop a note in the comments. We love hearing from you!

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk