Bot obsession  

One fateful day back in August of 2014 I happened to be working from home. During my lunch break an idea popped into my head that having a company chat bot might make for a few laughs around Wattpad HQ. I remembered how much fun we had at Polar mustachifying each other.

So, knowing how easy other integrations were to setup on Slack I thought lets see if I can get it working over lunch. I quickly settled on a Hubot and named him HAL, as one does. He was up and running on a free Heroku instance within the allotted time.

However my brief indulgence quickly turned into a madhouse of hilarity – How I was not fired that day, I will never know. Animated gifs and images were flying all over the place in #random. It was nearly impossible to keep up with it even if you dedicated your whole self to it, and nearly everyone had. Although I felt guilty for the time we lost, the laughs we had might have made it worth it. Of course the novelty wore off after a few days but hal continued to to be a source of humour and fun on Slack.

Fast forward to May 2015. I began recognizing the value of having a chatbot around to do our bidding. Weather, TTC alerts, etc. So I decided I would try to help ease the burden that often befalls a manger, ticket management. Staying on top of tickets (either bugs or features) from our millions of users and one hundred or so staff had become a job in it of itself. I often found the JIRA site slow and rather cumbersome to use, so I wanted to see if I could offload some of the burden on hal and thus JIRAbot was born ༼ つ ◕_◕ ༽つ.

It started off simple, about 40 lines of code simple. You typed

hal bug a summary of your issue

in one of the earmarked engineering channels and boom you got back a link to the JIRA ticket which had been filed against that engineering teams project.

It’s kinda silly, but stuff like this still makes me smile. It brings me back to what I love about computers and what you can teach them to do.

I think others on the team recognized the value as well. Things started to escalate quickly and the tool quickly evolved. I added the ability to file both feature and bug requests. Then one of our Android coops Stewart added the ability to input longer descriptions. Overtime we added the ability to add labels, assign, transition, rank, comment, search. You can also mention a ticket and see its details and any open pull requests associated with it.

I ran a query today and nearly 4,000 tickets have been filed using hal, which averages out at about 19 per day. Something that was unforeseen at the time was how this would change the way we work. The value this tool brings is not only in easing the burden of creating and managing tickets, it also increases communication and collaboration. I have observed countless instances of other team members offering insights on bugs as they are filed. I believe that is because of the specific restriction on where it can be used. Tickets can only be created (with hal) from the public team channel on Slack (they are explicitly mapped that way). This forces the conversation to happen in the open and facilities that feedback. Another important feature is that when the ticket is created through hal, a link is generated in the ticket body that lets you go back to the exact moment in the conversation when the ticket was filed. This context often makes understanding the issue at a later date that much easier.

Over march break, having had a little more free time then I’m used to I decided to spend some time refactoring the big ball of mess JIRAbot had become. It was getting difficult to navigate the monolith file I had created and it was clear to me that it was something worth maintaining and improving upon.

Of course, being the labour of love this has become I couldn’t help myself – I thought I should really take things to the next level. So I added proper Slack attachments to please the eye and reaction emoji support! So what does that look like?

jirabot demo

So now right after you file the ticket you can take quick actions (especially if you forgot to do add the syntax sugar during creation).

The reactions map to the following ticket actions:
? Rank to the top
? Rank to the bottom
? Watch this ticket
? Assign this ticket to me
? Transition this ticket to “Selected for Development”
⏩ Transition this ticket to “In Progress”

If you like what you see, then I have good news for you – Its all free and open source. You can explore our Hubot instance hal or poke through the newly refactored JIRAbot code or just get on with the npm module.

So you can fully appreciate the magnitude of the topic of this post I would also like to share these ready-to-go integrations:

and a few other one-off scripts that might not be as applicable to a larger audience:

and a few other internal Wattpad integrations I can’t share.

 
26
Kudos
 
26
Kudos

Now read this

iPhone 6

Like many other lunatics I awoke in the middle of the night to preorder a new iPhone. After having spent previous launches in line at carrier and Apple stores I decided that having it delivered to the office was the only grown-up thing... Continue →