Freshdesk
Integrate Agent Connect with Freshdesk for automatic surveys.
This integration guide describes how to integrate Medallia Agent Connect and Freshdesk to send survey requests automatically when tickets are solved.
The team member that has resolved the ticket has an approved Agent Connect profile.
The customer’s record includes an email address.
A team member is assigned to the ticket when it is solved.
Create a Do Not Send field
Create a check box field that enables agents to prevent an Agent Connect survey from being sent when they solve a ticket.
In Freshdesk, open Admin > General Settings > Ticket Fields, then click Add custom field.
Select "Checkbox".
Name the field Do not send Agent Connect request.
Drag the new field to your desired position on the ticket form, then click Save.
Agents can now select the Do not send Agent Connect request check box to prevent a survey from being sent.
Create rules
Create the rules that enable Agent Connect to email surveys to customers automatically when tickets are closed in Freshdesk.
Create a rule for interactions occurring through the email channel:
In Freshdesk, open Admin > Helpdesk Productivity > Observer, then click New Rule.
Name the rule Send Agent Connect request for email channel.
For event conditions in the rule, specify the event "Status is changed from Any Status to Closed" and any other conditions needed for your team's workflow.
Specify the following properties that identify the tickets affected by the rule:
"Source Is Email" (and other email-related channels, as needed, such as "Portal")
"Agent Is not None"
Any additional properties needed for your team's workflow
- In the Content field, enter the following advanced code:
{ "employee": { "email": " {{ticket.agent.email}}" }, "channel": "email", "customer": { "name": " {{ticket.requester.name}}", {% assign customer_email = ticket.from_email | strip %} "email": {% if customer_email and customer_email != "" %} "{{customer_email}}" {% else %} "no_email" {% endif %} }, "ext_interaction_id": " {{ticket.id}}", "do_not_send": " {{ticket.cf_do_not_send_stella_connect_request}}", "external_url": " {{ticket.url}}", {% assign raw_tags = ticket.tags | split: ' ' %} "tags": [ {% for tag in raw_tags %} "{{tag}}"{% unless forloop.last %},{% endunless %} {% endfor %} ] } Save the rule and toggle it on.
If needed, create a rule for interactions occurring through the phone channel:
Clone the email-channel rule.
Name the new rule Send Agent Connect request for phone channel.
For event conditions in the rule, keep the condition for "Status is changed from Any Status to Closed" and any other conditions needed for your team's workflow.
Specify the following properties that identify the tickets affected by the rule:
"Source Is Phone"
"Agent Is not None"
Any additional properties needed for your team's workflow
- In the Content field, enter the following advanced code:
{ "employee": { "email": " {{ticket.agent.email}}" }, "channel": "phone", "customer": { "name": " {{ticket.requester.name}}", {% assign customer_email = ticket.from_email | strip %} "email": {% if customer_email and customer_email != "" %} "{{customer_email}}" {% else %} "no_email" {% endif %} }, "ext_interaction_id": " {{ticket.id}}", "do_not_send": " {{ticket.cf_do_not_send_stella_connect_request}}", "external_url": " {{ticket.url}}", {% assign raw_tags = ticket.tags | split: ' ' %} "tags": [ {% for tag in raw_tags %} "{{tag}}"{% unless forloop.last %},{% endunless %} {% endfor %} ] } Save the rule and toggle it to on.
If needed, create a rule for interactions occurring through the chat channel:
Clone the email-channel rule.
Name the new rule Send Agent Connect request for chat channel.
For event conditions in the rule, keep the condition for "Status is changed from Any Status to Closed" and any other conditions needed for your team's workflow.
Specify the following properties that identify the tickets affected by the rule:
"Source Is Chat"
"Agent Is not None"
Any additional properties needed for your team's workflow
- In the Content field, enter the following advanced code:
{ "employee": { "email": " {{ticket.agent.email}}" }, "channel": "chat", "customer": { "name": " {{ticket.requester.name}}", {% assign customer_email = ticket.from_email | strip %} "email": {% if customer_email and customer_email != "" %} "{{customer_email}}" {% else %} "no_email" {% endif %} }, "ext_interaction_id": " {{ticket.id}}", "do_not_send": " {{ticket.cf_do_not_send_stella_connect_request}}", "external_url": " {{ticket.url}}", {% assign raw_tags = ticket.tags | split: ' ' %} "tags": [ {% for tag in raw_tags %} "{{tag}}"{% unless forloop.last %},{% endunless %} {% endfor %} ] } Save the rule and toggle it on.
Optionally, create a rule to automatically prevent surveys from being sent under specific conditions:
Note: You do not need to create a rule specifically to limit the number of surveys that a customer receives within a specific period of time. On the Company Info page, Agent Connect includes a suppression period that automatically stops surveys from flooding a customer within a specified number of days. For more information, see Company Info page.Click New Rule.
Name the rule Do not send Agent Connect Request.
For event conditions in the rule, specify the event "Status is changed from Any Status to Closed" and any other conditions needed for your team's workflow.
- Specify any properties that identify the tickets affected by the rule.
For example, the following image shows a rule that selects the Do not send check box when certain tags are used on a ticket:
- Save the rule and toggle it on.Important: To make sure Freshdesk checks your desired business rules before sending an Agent Connect request, order this exception trigger above all of the triggers that send requests.
Optionally, make revisions to the JSON payloads listed in the rules above to account for advanced configurations used by your company.
- If you use multiple brands in Agent Connect, modify the JSON payload to indicate the brand for each interaction. The following example uses the email channel and a custom field on the ticket called
brand
:{ "employee": { "email": " {{ticket.agent.email}}" }, "channel": "email", "customer": { "name": " {{ticket.requester.name}}", {% assign customer_email = ticket.from_email | strip %} "email": {% if customer_email and customer_email != "" %} "{{customer_email}}" {% else %} "no_email" {% endif %} }, "brand": " {{ticket.brand}}", "ext_interaction_id": " {{ticket.id}}", "do_not_send": " {{ticket.cf_do_not_send_stella_connect_request}}", "external_url": " {{ticket.url}}", {% assign raw_tags = ticket.tags | split: ' ' %} "tags": [ {% for tag in raw_tags %} "{{tag}}"{% unless forloop.last %},{% endunless %} {% endfor %} ] } - If you use multiple languages in Agent Connect, modify the JSON payload to indicate the language code for each interaction. For information about the language codes used in Freshdesk, see the official Freshdesk documentation. The following example uses the email channel and the ticket requester locale:
{ "employee": { "email": "{{ticket.agent.email}}" }, "channel": "email", "customer": { "name": "{{ticket.contact.name}}", {% assign customer_email = ticket.contact.email | strip %} "email": {% if customer_email and customer_email != "" %} "{{customer_email}}" {% else %} "no_email" {% endif %} }, "language": "{{ticket.contact.language}}", "ext_interaction_id": "{{ticket.id}}", "do_not_send": "{{ticket.cf_do_not_send_stella_connect_request}}", "external_url": "{{ticket.url}}", {% assign raw_tags = ticket.tags | split: ' ' %} "tags": [ {% for tag in raw_tags %} "{{tag}}"{% unless forloop.last %},{% endunless %} {% endfor %} ] }
Move your integration to production
Work with the Agent Connect team to test your automated integration and resolve any issues. When everything is working as expected, move your integration to production.
In Freshdesk, open Admin > Helpdesk Productivity > Observer.
For each rule you created, change the password to your Agent Connect Production API Key (available on the Integrations page in Agent Connect).
In Agent Connect, open the Integrations setup page.
For each channel you integrated, switch that field on, then click Update.