Teneo Developers

Freshservice

The Freshservice example solution showcases how you can use your Teneo bot to allow users to create and manage tickets using the Freshservice API. The solution contains an integration with Freshservice and example flows to create, read, update and delete support tickets.

freshservice long

Solution contents

Freshservice API integration

The solution contains a Freshservice backend integration with the following methods:

  • Filter tickets
  • Create ticket
  • Update ticket status
  • Read ticket
  • Delete ticket
  • Add note to ticket

The methods make use of a class called FreshserviceHelper. You can find the FreshservicehHelper.groovy file with the source code in the resource file manager of the solution. This allows you to easily modify or extend the class if needed.

You can edit the class straight from Teneo by selecting the FreshserviceHelper.groovy file and clicking 'Open'. See: Opening and editing files in an external editor for more details.

Example flows

For each core method in the Freshservice integration, the solution contains a corresponding example flow:

  • Lookup ticket by id
  • Filter tickets
  • Create a new ticket
  • Delete ticket
  • Update ticket
  • Add note to ticket

Getting started

Prerequisites

These instructions assume you have a Freshservice account with an active API token. Using hardcoded API tokens in your solution is recommended for testing purposes only. In your live solution you will want to generate OAuth credentials.

These instructions assume you have a Freshservice admin account. Alternatively, you can signup for a free user account on Freshservice.
These instructions assume you have downloaded and imported the Freshservice solution. See instructions below.

Getting the Freshservice API Access information

To be able to interact with the Freshservice API some keys and tokens need to be stored in the solution. Below is a list of the required global variables and where you can find them in the Freshservice UI:

Variable NameLocation
FreshserviceAccessTokenLog in to the Freshservice UI as an organization administrator. Click on your profile picture on the top right corner of your portal. Go to Profile settings Page. Your can find your API key in the righthand panel under Your API Key. Note you will first need to select 'I am not a robot' before the API key is displayed.
FreshserviceUserEmailThis is the email address to the end user of the system. In a real solution this would be supplied as input parameter when the user logs in to the system.
FreshserviceSupportBaseUrlThis is the base URL to your Freshservice organization.

Store these values in the corresponding global variables in your Freshservice solution in Teneo. Make sure you hit 'Save' in the top right corner each time you update a global variable field.

Note also that in order to set ticket priority via the API, priority matrix must be disabled on your account. This can be configured through Admin menu, Priority Matrix.

Try it Out

After you have added the details above, you can try it out as follows:

User: Create ticket
Bot: Please describe the issue.
User: My computer is on fire
Bot: Select a ticket priority: low, medium, high, urgent.
User: urgent!
Bot: Please specify a subject for your ticket. This should be a brief summary of the issue that allows the agent to quickly understand and assign your ticket to the appropriate channel.
User: FIRE!
Bot: Ticket #2 has been created on your behalf

User: Add comment to ticket 2
Bot: What is the note you would like to add to ticket #2?
User: I've extinguished the flames
Bot: Your note: I've extinguished the flames has been added to ticket #2.

User: Update ticket 2 priority to low
Bot: Ticket #2 has been updated to priority low.

User: check ticket
Bot: What is your ticket id number?
User: 2
Bot: The status of ticket #2 is open. The last note on the ticket is: I've extinguished the flames.

User: show my open tickets
Bot: You have the following tickets open:
Ticket #1 with subject: BROKEN is open. Ticket #2 with subject: FIRE! is open.

User: delete ticket 2
Bot: Ticket #2 has been deleted.

How does it work?

Each flow in the solution calls its respective corresponding method to either create, update or change the status of a ticket. It achieves this by making API calls to the Freshservice API.

Download

Download the solution here.

Import the solution into Teneo. For more details see: How to import solutions.