All Collections
Getting started
Integrations
Freshservice & Freshdesk
Freshdesk: Setting up Automatic Ticket Categorization using Labelf
Freshdesk: Setting up Automatic Ticket Categorization using Labelf

In this article we explain how to integrate your Labelf AI model with Freshdesk in order to achieve automatic ticket categorization

Per Näslund avatar
Written by Per Näslund
Updated over a week ago

This article assumes that you already have trained a model in Labelf. To do this based on your own Freshdesk tickets, you can export them from Freshdesk (make sure to get description, hidden behind "Show multiline text fields" toggle) and then train your own model in the Labelf platform. The labels you set in Labelf must match the ticket field option names in Freshdesk for this to work. Write to our support using the chat bubble in the corner in case you need help with this.

1. Go to your profile settings in Freshdesk by clicking the circular icon in the top right corner

2. On the right side panel, there is a section saying "Your API key", copy the API key.

3. Go to the integration page in the Labelf app and enter your API-key and Freshdesk domain in the Freshdesk section. An example of a domain could be "labelf" as in "labelf.freshdesk.com"

4. Go to your Freshdesk admin page and click "Automations" under the "Workflows" section.

5. Make sure you are on the "Ticket Creation" tab and then hit "New rule":

6. Give it a Relevant name and add a condition that suits the tickets you want to match. In this case, we want to match all new tickets, so we have added the condition "Ticket status is not Resolved/Closed" which would catch all incoming tickets. It would make more sense to not put a condition at all in this case, but Freshdesk does not allow that.

7. Under "Perform these actions", choose "Trigger Webhook" and request type "POST". Then set the url to the following:

https://api.app.labelf.ai/v2/freshdesk/classify_ticket

8. In the next part, check the box "Requires authentication" and then "I have API key".

input the Labelf API key that you can get from: https://app.labelf.ai/create-workspace-token

9. In the next part, check the "JSON" radio button under "Encoding", then "Advanced" under "content". Fill in the following JSON string in the text area, but change "YOUR MODEL ID" to the model id of your own Labelf AI model that can be found on the model overview page in app.labelf.ai. You also need to change "YOUR FIELD NAME" to whatever field you want to update in Freshdesk. If your field name is for example "Ticket Category" you will have to change it to "cf_ticket_category" so that the API understands. Basically replace spaces with underscores, make it all lowercase and add "cf_" in the beginning. Also, since "YOUR MODEL ID" is numeric, it shouldn't have quotation marks around it.

{
"text": "{{ticket.subject}}. {{ticket.description}}",
"ticket_id": {{ticket.id}},
"model_id": YOUR MODEL ID,
"field_name": "YOUR FIELD NAME"
}

It will look like the following:

13. Now hit "Preview and save" and try to see if the preview looks good. For the use case above, it should look like this:

14. If you are happy with the preview, hit "Save and enable". You can now send a test ticket to your system and see if the ticket field you used is automatically populated. If it is not happening, you can reach out to our support in the bottom right corner and we'll help you out.

Did this answer your question?