webhooks/freshdesk: Update docs to conform to new style guide.

This commit is contained in:
Eeshan Garg
2018-04-17 18:59:41 -02:30
committed by Rishi Gupta
parent 057ff9c91e
commit 0a7d1bc746
11 changed files with 81 additions and 126 deletions

View File

@@ -1,142 +1,97 @@
See customer support interactions right in Zulip, with our Freshdesk
integration! Note that this integration must be set up by an
administrator for your Freshdesk instance.
See customer support interactions in Zulip with our Freshdesk
integration!
{!create-stream.md!}
1. {!create-stream.md!}
Next, on your {{ settings_html|safe }}, create a Freshdesk bot.
1. {!create-bot-construct-url-indented.md!}
Now we can set up the Freshdesk events that will trigger Zulip's.
Freshdesk provides separate triggering mechanisms for ticket
creation and ticket changes, so we'll set up these triggers in two
parts.
### Add notifications for new Freshdesk tickets
### Part 1: Zulip notifications for new Freshdesk tickets
1. Go to your Freshdesk **Admin** page. Under **Helpdesk Productivity**,
click on **Dispatch'r**. Click on **New rule**.
1. Visit your Freshdesk admin page. Under the **Helpdesk Productivity**
section, click the **Dispatch'r** icon:
![](/static/images/integrations/freshdesk/001.png)
1. Set **Rule Name** to a name of your choice, such as `Zulip`. There isn't a shortcut
for "always generate a notification on ticket creation", so we'll have to
fake it by picking two complementary conditions: when the source **is email**,
and when the source **is not email**. Set up the **Conditions** for the
new rule, like so:
2. Click the **New rule** button to create a new Dispatch'r rule that
will send notifications to Zulip when Freshdesk tickets are opened.
![](/static/images/integrations/freshdesk/001.png)
3. On the Dispatch'r rule creation page, give the rule a name and
description. Next, we need to specify the conditions under which to
trigger Zulip notifications. There isn't a shortcut for "always
generate a notification on ticket creation", so we'll instead fake it
by picking two complementary conditions: when the source **is email**,
and when the source **is not email**:
![](/static/images/integrations/freshdesk/002.png)
1. Under **Actions**, set the **Select Action** dropdown to **Trigger Webhook**.
Set **Request Type** to **POST**, and set **Callback URL** to the URL
constructed above.
4. In the **Action** section, add a new action of type **Trigger Webhook**.
Set the **Request Type** to **POST**. Set the following **Callback URL**,
replacing the Zulip stream with your desired stream:
`{{ api_url }}/v1/external/freshdesk?stream=freshdesk`
1. Check the **Requires Authentication** checkbox. Set **Username** to the email
of the bot created above, and set **Password** to the bot's API key. Set
**Encoding** to **JSON** and select the **Advanced** option. Copy and paste
the following JSON into the **Content** box:
5. Check the **Requires Authentication** box, and supply the bot email
address and API key. The **Action** section should look like this so
far:
![](/static/images/integrations/freshdesk/003.png)
6. Select **JSON** for the **Encoding**. Under the encoding, select
**Advanced**. Paste the following JSON into the **Content** box:
```
{"freshdesk_webhook":
{
"triggered_event":"{{triggered_event}}",
"ticket_id":"{{ticket.id}}",
"ticket_url":"{{ticket.url}}",
"ticket_type":"{{ticket.ticket_type}}",
"ticket_subject":"{{ticket.subject}}",
"ticket_description":"{{ticket.description}}",
"ticket_status":"{{ticket.status}}",
"ticket_priority":"{{ticket.priority}}",
"requester_name":"{{ticket.requester.name}}",
"requester_email":"{{ticket.requester.email}}",
}
}
```
These ticket details are what will be forwarded to Zulip. The
pasted JSON should look like this:
![](/static/images/integrations/freshdesk/004.png)
Lastly, save your new Dispatch'r rule. The next time a Freshdesk ticket
is opened, the team will get a notification in Zulip!
If you only want to receive Zulip notifications on ticket creation,
stop here, you're done! If you also want notifications on important ticket
changes, please continue to the next section.
### Part 2: Zulip notifications on ticket changes
1. Visit your Freshdesk admin page. Under the **Helpdesk Productivity**
section, click the **Observer** icon:
![](/static/images/integrations/freshdesk/005.png)
2. Click the **New rule** button to create a new Observer rule that will
send notifications to Zulip when Freshdesk tickets are updated.
3. On the Observer rule creation page, give the rule a name and
description. Under **When Any Of These Events Occur**, create
these new rules:
* Priority is changed, from Any Priority, to Any Priority
* Status is changed, from Any Status, to Any Status
* Note is added, Type Any
4. If you do not want to receive Zulip notifications on one or more of
these events, leave out the rule for that event.
5. Under **And The Events Are Performed By**, select **Anyone**.
So far, the rule should look like this:
![](/static/images/integrations/freshdesk/006.png)
6. Next, we need to specify the types of tickets that will trigger
Zulip notifications. There isn't a shortcut for "always generate a
notification on ticket update", so as before we'll instead fake it by
picking two complementary conditions: when the source **is email**,
and when the source **is not email**:
![](/static/images/integrations/freshdesk/007.png)
7. Under **Perform These Actions**, add a new action of type
**Trigger Webhook**. Set the **Request Type** to **POST**. Set the
following **Callback URL**, replacing the Zulip stream with your
desired stream:
`{{ api_url }}/v1/external/freshdesk?stream=freshdesk`
8. Check the **Requires Authentication** box, and supply the bot e-mail
address and API key. The Action section should look like this so far:
![](/static/images/integrations/freshdesk/008.png)
9. Select **JSON** for the **Encoding**. Under the encoding, select
**Advanced**. Paste the following JSON into the **Content** box:
```
{"freshdesk_webhook":
{
"triggered_event":"{{triggered_event}}",
"ticket_id":"{{ticket.id}}",
"ticket_url":"{{ticket.url}}",
"ticket_type":"{{ticket.ticket_type}}",
"ticket_subject":"{{ticket.subject}}",
"ticket_description":"{{ticket.description}}",
"ticket_status":"{{ticket.status}}",
"ticket_priority":"{{ticket.priority}}",
"requester_name":"{{ticket.requester.name}}",
"requester_email":"{{ticket.requester.email}}",
```
{"freshdesk_webhook":
{
"triggered_event":"{{triggered_event}}",
"ticket_id":"{{ticket.id}}",
"ticket_url":"{{ticket.url}}",
"ticket_type":"{{ticket.ticket_type}}",
"ticket_subject":"{{ticket.subject}}",
"ticket_description":"{{ticket.description}}",
"ticket_status":"{{ticket.status}}",
"ticket_priority":"{{ticket.priority}}",
"requester_name":"{{ticket.requester.name}}",
"requester_email":"{{ticket.requester.email}}",
}
}
}
```
```
These ticket details are what will be forwarded to Zulip. The
pasted JSON should look like this:
Click **Save**.
![](/static/images/integrations/freshdesk/009.png)
### Get notifications for changes to existing tickets
Finally, save your new Observer rule. The next time a Freshdesk
ticket is updated, the team will get a notification in Zulip!
1. Go to your Freshdesk **Admin** page. Under **Helpdesk Productivity**,
click on **Observer**, and click on **New rule**.
1. Set **Rule Name** to a name of your choice, such as `Zulip`.
Under **involves any of these events**, create new events as shown below:
![](/static/images/integrations/freshdesk/002.png)
1. Unfortunately, there isn't a shortcut for specifying "all tickets",
so we'll have to fake it by picking two complementary conditions:
when the source **is email**, and when the source **is not email**.
Under **on tickets with these properties**, create new conditions,
like so:
![](/static/images/integrations/freshdesk/003.png)
1. Under **perform these actions**, set the **Select Action** dropdown
to **Trigger Webhook**. Set **Request Type** to **POST**, and set
**Callback URL** to the URL constructed above.
1. Check the **Requires Authentication** checkbox. Set **Username** to the email
of the bot created above, and set **Password** to the bot's API key. Set
**Encoding** to **JSON** and select the **Advanced** option. Copy and paste
the following JSON into the **Content** box:
```
{"freshdesk_webhook":
{
"triggered_event":"{{triggered_event}}",
"ticket_id":"{{ticket.id}}",
"ticket_url":"{{ticket.url}}",
"ticket_type":"{{ticket.ticket_type}}",
"ticket_subject":"{{ticket.subject}}",
"ticket_description":"{{ticket.description}}",
"ticket_status":"{{ticket.status}}",
"ticket_priority":"{{ticket.priority}}",
"requester_name":"{{ticket.requester.name}}",
"requester_email":"{{ticket.requester.email}}",
}
}
```
Click **Save**.
{!congrats.md!}
![](/static/images/integrations/freshdesk/010.png)
![](/static/images/integrations/freshdesk/004.png)