Setup a ticketing bot

In this tutorial we will setup a bot that operates as a ticketing management system. The bot will let us:

  • Create a new ticket
  • Check ticket status
  • Update a ticket

To setup this bot, we will need:

Setting up your bot

First we need to setup our bot to accept ticketing information. Once all the messages are setup, we can then use attributes to parse ticket information to a Google Sheet for further processing.

You can use the below bot flow for guidance to setup your bot. Ideally, you would take necessary information about the ticket and pass it through a webhook into Integromat to perform inquiries on a Google sheet where ticket information is stored.

23572357

Welcome message of the bot can provide user with different options to choose from:

356356

Sending ticket information to Google Sheet

To send information of a new ticket to a spreadsheet, we need a Q&A message which takes the input from a user in text format. We also need to ensure this text information is being recorded in an attribute which will be passed through to a webhook.

Once a user submits their ticket description, we will trigger the webhook to send the ticket information to our spreadsheet. We also need to ensure the webhook response provides the user with a unique ticket id to query ticket status in the future.

Our final Integroamt flow will look like this:

15481548

Here's what each module is doing in this flow:

  • Webhooks: To receive the ticket information from the bot
  • Tools (Set variable): We are using the timestamp information from the webhook to generate a unique ticket id
  • Google Sheets (Add a row): The flow to add the ticket information in our Google Sheet
  • Webhooks (Webhook Response): This is our response message to the user after the ticket has been created.

Set variable module:

This flow takes the timestamp from the webhook and generates a unique ticket id using the last four digits of the timestamp as our unique ID. This is just an example, you can use your own preferred naming convention for generating a unique ID.

802802

In the above example, we took the 'timestamp' information from the webhook. A time stamp has 13 digits, we are using the 'substring' feature within Integromat to extract last 4 digits.

500500

After setting the ticket ID, add a new module and chose 'Add a row' from Google Sheets.

Here we will configure the ticket information we are pushing to our webhook. In our use case, we used the following headers for our Google Sheet:

  • Ticket ID
  • Description
  • Status
  • Logged by user
  • FBID
  • Feedback
  • Date Submitted

These can be different for your use case, feel free to add or delete anything that you might not need. You can see the configuration below:

500500

In the last step, we will add another module and look for 'Webhook Response':

826826

Use the following code for your webhook response:

{
  "recipient": {
    "id": "{{1.fbuser.fbid}}"
  },
  "message": {
    "text": "Your ticket has been registered with Ticket ID {{5.ticketid}} "
  }
}

Replace the 'ID' and 'ticketid' parts if you are using different variables for this purpose. If not, you can copy and paste this in your Integromat webhook response module.

Please ensure you save your scenario at each step to avoid losing any progress. At the end, turn on the scenario and it's time to test the bot.

If everything works as expected, you should see an update on your Google Sheet with the ticket information you submitted:

840840

The bot should respond with a ticket ID as seen below:

881881

Happy ticketing!


What’s Next

After setting up the above flow. You can explore adding further functionality to your bot. See examples linked below: