Making HipChat Even Hipp-ier: Automating Your Chats with CloudBees Flow

Written by: Electric Bee

2 min read

Stay connected
whats-hipchat-campaignIf you're like me - you love HipChat  (and boy, do I LOVE their Office Space Ads!) HipChat is my go to tool to talk and sync up with my team. My colleague Nitin Parashar , who has to kick start daily scrums on Hipchat at 8am sharp, came up with this cool idea to get a time-based schedule in CloudBees Flow  to do it for him instead - since at CloudBees, we’re all about automation. The way it works is an CloudBees Flow schedule kicks off at 8am every weekday, which interacts with Hipchat’s REST API to post a message on Nitin’s behalf. Setting it up is a snap! HipChat-logo

Integrating HipChat and CloudBees Flow:

  1. To post data to Hipchat, you need an auth token, which can be easily generated . In this example, we've hard-coded the token, but you can use CloudBees Flow Credentials to secure that information.
  2. Then, do a simple REST call to Hipchat’s API:
    #!/bin/bash
    ROOM_ID=408129
    
    AUTH_TOKEN=yourauthtokenhere
    _now=$(date +"m-d-Y")
    MESSAGE="=======  $_now -  Daily Scrum START  ========"
    
    curl -H "Content-Type: application/json" \
        -X POST \Ô
        -d "{\"color\": \"green\", \"message_format\": \"text\", \"message\": \"$MESSAGE\" }" \
        http://api.hipchat.com/v2/room/$ROOM_ID/notification?auth_token=$AUTH_TOKEN
  3.  You can obtain the room ID by logging into the HipChat web app.
  4. The green color simply serves to differentiate the message from the rest: hip-chat message
  Go ahead- give it a try! This is undoubtedly a simple example, but you can easily build on that to include HipChat as part of your automation flow.  We have customers who use HipChat as their terminal to view/report/alert on certain events in their process. For example: a failed build or automatic notification of machines being ready, etc. Hope you like incorporating HipChat to your processes with CloudBees Flow as much as we did. Got any questions? hit me up in the Comments. And in conclusion, let me leave you with this important question to ponder on: how can we do better, as a team?

Stay up to date

We'll never share your email address and you can opt out at any time, we promise.

Loading form...
Your ad blocker may be blocking functionality on this page. Please disable for an improved experience.