DrTomAllen.com
tom@jugglethis.net
  • Dr Tom
  • Now
  • Consulting
    • Testimonials
  • Robotics
    • Publications & Videos
  • Startups
    • Cubescape
    • Triple Point Robotics
  • Game Design
    • Bounces
    • Dodgy Wiring
    • Half the Battle
    • Road to Nowhere
    • Summon the Swarm
    • Evil Robots
    • Spelled
  • Blog

Using Clubhouse's webhooks to announce ticket completion in Slack

17/10/2019

 
Clubhouse is a great tool for software teams to manage their work. It includes a Slack integration that can pick up ticket URLs in chats and expand them with details, and can also generate a message feed of activity on those tickets.

What it can't do however, is narrow down that firehose to just a few types of activity that are of interest. This post shows how to use Microsoft Flow (similar to IFTTT or Zapier) and Clubhouse's webhooks to build it yourself.

In the gallery below, you can see the gist of the flow:
1) The flow's trigger is receipt of a JSON payload into a webhook destination. This webhook URL is added to  Clubhouse's webhook integration in the Clubhouse settings.
2) The schema of that JSON is automatically created by posting in a sample payload from Clubhouse's webhooks API documentation (or just copy the code sample shown below)
3) A few conditions are checked - `actions` is present and set to `update`, `changes` exists under that and is set to `completed`, etc - and finally the inner block of JSON under `changes` is parsed to expose the fields of interest.
4) Finally, a message is posted to Slack that reports the activity type we're interested in.
Ultimately, the output ends up as a nicely formatted Slack message with a direct link back to the original ticket. The flow itself runs once per activity on any Clubhouse ticket, but only posts to Slack for those activities that we actually care about.
Picture
It would be great if Clubhouse would update their Slack integration to allow us to use multiple of them per workspace, and filter the output directly - but until that's possible, this hack has helped us raise the signal to noise ratio!

It's also possible to query the Clubhouse API directly from a flow (or an IFTTT, or a Zap). For example, I could have updated this to query the ticket details and pull out the owner's names, or the date it was started, etc. I'll leave that as an exercise for the reader...
JSON Schema for Base Webhook Payload

    
JSON Schema for `changes` payload

    

Comments are closed.
    This blog is very seldom updated. Having kids will do that.
    ​

    Archives

    October 2022
    August 2021
    October 2019
    June 2019
    February 2016
    July 2015
    July 2014
    June 2014
    February 2014
    October 2013
    September 2013
    May 2013
    April 2013
    March 2013
    November 2012
    September 2012
    August 2012
    June 2012
    May 2012

    Categories

    All
    Coffee
    Hacking
    Programming
    Projects
    Rants
    Robots
    Startups
    Thoughts

    RSS Feed