HipChat Integration

HipChat + AgileZen + TeamCity + github

One of the first things we did when we formed the team was get a HipChat account set up. I’ve used Campfire for years but recently discovered HipChat and have fallen in love.  The big things HipChat has over Campfire are:

  • If you’re not in the room or you’re idle and someone mentions your @name you’ll get an email. This seems “neat” but really it increases the power of the chat room, especially for a distributed (in both time and space) team. Joe’s not around when you’re on? No worries, don’t fire up gmail, just @mention him in chat.
  • The API allows for a little bit more formatting. You can do actual <a href=””></a> tags to shorten links, you can bold, etc. Quite nice for the integrations I’m about to talk about.
  • Nice AIR client with customizable notifications. I have it only notify me if I’m mentioned so that I’m not constantly distracted by other things going on. If you want someone’s attention, you mention them.
  • Private messaging. Obviously we could just use Skype or gtalk or one of the million other ways we have to communicate, but having it all integrated is quite nice. It even has video chat built in but I won’t list that separately because it’s flash based and not that good. Stick to Skype for that.

Integrating with Github

This one’s easy. It’s built into Github, so all you need to do is go to your repo’s Admin, then Service Hooks, check HipChat and plug your API key in, which you can get from HipChat’s admin pages.

Integrating with AgileZen

This is a little bit more complicated. AgileZen supports notifications to Jabber, but not directly to HipChat. Here’s how I did it:

  1. First thing’s first, make sure you have a machine running somewhere that you can run a daemon on permanently. We used our TeamCity machine. We’ll come back to this later.
  2. Create a gmail account for your bot. It has to be an actual @gmail account, Google Apps for your domain accounts won’t work unless you do this.
  3. In AgileZen, under settings, go to the Notifications tab. Enable a “Google Talk / XMPP” Channel Type and set the username to yournewaccount@gmail.com
  4. Check “Send me notifications for actions I perform”
  5. Login to your new gmail account and add notifications@jabber.agilezen.com as a contact on google talk
  6. Move a card on your board in AgileZen to see if you get a chat message in gtalk. If so, you’re good to go. If not, try removing and adding the zen jabber account again.
  7. Set up the below script and run it. More instructions on this at the bottom. That should be it.

Integrating with TeamCity

Just like HipChat, TeamCity has a way to talk to Jabber, but no way to talk to HipChat directly so integrating is similar to above.

  1. Login to TeamCity as an admin, go to Administration>ServerConfiguration>Jabber Notifier
  2. Set:
    • Jabber server: talk.google.com
    • Server port: 5222
    • Server user: Different gtalk username than the receiving one. This can be your own account or you can create one for this.
    • Server user password: password
  3. Make sure that the receiving account (See step #2 in the HipChat configuration) has the sending account as a contact and you can send and receive messages between them.
  4. Test the connection.
  5. Under My Settings & Tools, set your Jabber Notifier account to the receiving account.
  6. Click Edit and configure it as you see fit. I set it to all projects and notifications on success, failure, failure to start and hanging.
  7. Use the below script and you should be good to go.

AgileZen/TeamCity Jabber->HipChat Script

You’ll need this to actually make everything work together.

  1. Grab this script.
  2. Make sure your environment is set up as the script mentions, you’ll need a few gems and Ruby 1.8.7
  3. Change your settings in the script
  4. Run the script with ruby scriptname.rb start to start a daemon or run to run it in the foreground
  5. Start a build or move some cards around to test

Let us know if you use this and how it works out for you. Best of luck, and happy HipChatting!