Skip to content

Instantly share code, notes, and snippets.

@henrik
Created September 30, 2012 17:19
Show Gist options
  • Save henrik/3807718 to your computer and use it in GitHub Desktop.
Save henrik/3807718 to your computer and use it in GitHub Desktop.
Automatically posting new Zendesk tickets to HipChat.

Set up like so: https://support.zendesk.com/entries/382630-hipchat-integration

Add the target here: http://support.YOURDOMAIN.com/settings/extensions#targets

Set up the trigger here: http://support.YOURDOMAIN.com/rules?filter=triggers

Possibly we had to put something ("x") in the trigger action message, even though the instructions above gave the impression you could leave them blank.

We used this for the request URL:

http://api.hipchat.com/v1/rooms/message?auth_token=CHANGE_THIS&room_id=CHANGE_THIS&color=purple&from=ZenDesk&message=%3Ca+href%3D%22http://{{ticket.url}}%22%3E{{ticket.id}}.+{{ticket.title+|+truncate:100}}%3C/a%3E+{{ticket.description+|+truncate:400}}

That shows "1234. The title. The description." with the ticket id and title linked, and both title and description truncated to a max length.

The ticket.description includes an ugly prefix with the sender name and date, but I haven't found a way to lose that without breaking the truncation (as ticket.latest_comment will).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment