back to Jitbit Blog home About this blog

Rule-based chatbots in Jitbit Helpdesk using "rule chaining"

by Alex Yumashev · Updated Apr 3 2019

Our "Automation engine" has been out for a while now and I'm happy to see that it's the most heavily used feature in our help desk software. Clients use it for all sorts of tasks: to send out auto-responders, to auto-assign tickets to helpdesk "agents", to notify administrators when a ticket stays untouched for more than X days, to escalate "overdue" tickets etc. etc.

But one important feature was missing until now: you couldn't automate a dialog with a customer. I.e. you cannot ask a question and then perform some actions depending on the customer's response. This became an even bigger problem after we introduced the live chat feature in helpdesk app. People wanted to build chat bots! But they couldn't - not with the tools we offer.

Now we have finally solved this problem by introducing some new enhancements to our Automation Rules engine.

Real world use case

Here's a real world example from our own customer service experience. When a ticket comes in - "hey something is not working in our helpdesk app!" - we almost always ask the same questions over and over:

  1. Are you using the hosted or the self-hosted version?
  2. If it's the hosted one - what is the URL?
  3. If it's self-hosted - what is the version number you have?

I told myself I needed a tool for that.

We need a "conversational" workflow

The previous "automation rule" architecture had only three "steps":

  1. When [event] happens
  2. And [conditions] are met
  3. Do these [actions]

Which makes it very complicated to achieve the desired effect - a "conversation" that changes its flow depending on subsequent responses from a customer. Like "Ask question X, if response is Y - ask question Z, if response is Y1 - ask question Z1" and so on and so on, an unlimited flow.

You could, of course, use a hack. Add several "when a response comes in" rules (all of them will be triggered by a customer's message) but use hidden custom fields to decide which rule should be triggered next. But this is way too complicated.

We needed to find a way to solve this problem. Preferably an easy-to-use one. Ideally - the one with a trivial UI, that even non-programmers will understand.

First step: adding an "ELSE" flow

The first step was to add an "ELSE" workflow to our engine. So the rules work like this:

  1. When [event] happens
  2. And [conditions] are met
  3. Do these [actions]
  4. ELSE do other [actions]

This is a nice addition that everyone will understand and it does not complicate the UI much.

Second step: adding workflows and rule "chaining"

The next challenge was adding a simple way to "do XXX and then wait for the next event". I considered a lot of different options, like building a drag-and-drop workflow designer (ruins the simplicity of our current UI) or even building our own script-engine (again - ruins the simplicity and flattens the learning curve). But then it occurred to me, that rules should be "chainable".

Here's what it should be:

  1. When XXX happens
  2. And YYY conditions are met
  3. Do these [actions]:
    1. Action 1: aaa
    2. Action 2: bbb
    3. Action 3: trigger another rule which will, optionally, wait for its own trigger

TL;DR building a simple automated chatbot using Jitbit Helpdesk

Let's go back to our earlier use case:

"Hey, my helpdesk app does not work - Are you on the hosted version? - YES - Tell us your URL"

OR

"Hey, my helpdesk app does not work - Are you on the hosted version? - NO - So it's your own server then, please tell us your version number"

Basically we create two automation rules. (1) is triggered when a ticket comes in and asks the customer if it's the hosted version. (2) is triggered by (1), waits for the next reply and if it's hosted - ask for the URL, else ask for the version number.

They say a picture is worth a thousand words, well a video is worth a million. Check it out: