1. Home
  2. Integrations
  3. HipChat Multi-Channel Integration Guide – VictorOps

HipChat Multi-Channel Integration Guide – VictorOps

HipChat is hosted group chat and video chat built for teams. Supercharge real-time collaboration with persistent chat rooms, file sharing, and screen sharing. This integration allows you to send VictorOps information to specific rooms based on the alert fields of your choice. This is a different integration then our single room bi-directional integration, for more on that visit the article here: HipChat Integration.

In HipChat

Start by creating a custom integration. Select Integrations then Build your own integration

multi1

Select the room you want to create the integration for and give the integration a name.

multi2

A URL will be generated that allows you to “Send messages to this room by posting to this URL”. Copy this URL to your clipboard. The URL contains two items we will need to use in later parts of this article, the room ID and the authentication token. Find them in bold here:

https://YOUR_DOMAIN.hipchat.com/v2/room/ROOM_ID/notification?auth_token=AUTH_TOKEN_HERE

Save your new custom integration.

In VictorOps

First we will setup a Transmogrifier rule that will add the room ID and authentication token to the alerts you want sent into the specified room. In this example we are setting the room_id field and auth_token field when we match on the routing key “devops”.
multi3

This will allow you to change the room_id and auth_token depending on the type of alert. In the example we match on the routing key “devops” but you can match on any alert field.

Next we will need to set up an Outbound Webhook to send VictorOps information to your HipChat room(s).

From the VictorOps timeline select Settings then Webhooks then Add Webhook.

mutli4

Select the “Event” you want to forward to HipChat, in our example we are sending a message every time an incident is triggered.

Set the “Method” to “POST”.

Set the “Content Type” to “application/json”

For the To address paste in your HipChat room endpoint. If you are sending to multiple rooms based on alert type, you will need to replace the “room id” and “auth token” variables with the alert fields you created in the transmogrifier. For example:

https://YOUR_DOMAIN.hipchat.com/v2/room/${{ALERT.room_id}}/notification?auth_token=${{ALERT.auth_token}}

For the payload section, you can add a number of different variables. For more information see the HipChat documentation here. In our example we are sending a simple colored message that contains alert information found in the “state_message” field.

 

{
  "color": "red", 
  "message": "${{ALERT.state_message}}", 
  "notify": true, 
  "message_format": "text"
}

The final result should look something like:

multi5

Additional webhooks can be created for other events in the VictorOps system. If you have any questions please reach out to VictorOps support.

 

Updated on March 13, 2017

Was this article helpful?

Related Articles