How to connect OTRS with Zendesk

Robert Ullrich15. Jun 2017 | ConsultingUse cases

With the OTRS Business Solution™ 5s, you have the possibility to connect OTRS with Zendesk. The following article will explain how to configure the ZendeskConnector to establish a connection between OTRS and Zendesk.

To complete this Howto, you need a running OTRS & a valid Zendesk-System. Furthermore, you need a valid agent login. The REST/JSON API of Zendesk is activated by default. We should use the “Password Access” method.

Zendesk Config Screen

OTRS Requirements for this HowTo:

OTRS Framework

The following OTRS framework is required:

  • 5.0.x

OTRS Packages

You need the following Freely selectable Features of the OTRS Business Solution™ 5s :

  • OTRSGenericInterfaceInvokerTicket
(Adds new invoker for TicketCreate and TicketUpdate in the GenericInterface.)
  • OTRSGenericInterfaceInvokerEventFilter
(Contains additional functionalities to add conditions to events of invokers.)

Third Party Software

You need this third party software:

  • XML::Simple
  • XML::LibXML
  • XML::LibXSLT

DynamicFields

  • DynamicField “ZendeskID” of type „TEXT“
  • DynamicField “ZendeskIDJSON” of type „TEXT“
  • another DynamicField “ZendeskState” of type “TEXT”

Configuring the ZendeskConnector in OTRS

When you’re done with the pre-requirements, you have to create a new web service within OTRS. Afterward, we’ll set up the needed requester invokers.

The name of the new web service could be ZendeskConnector:

ZendeskConnector GeneralConfig

 

Configuring the Invoker “TicketCreate”

Now we’re ready to start the configuration of our Invokers. To be able to create tickets in Zendesk, we’ve to set up our first Invoker called “TicketCreate”.  Select all the needed data for your outgoing requests and use “XSLT” as mapping for your outgoing and incoming response data.

ZendeskConnector CreateTicket Invoker

For the incoming response data, we’ve to use the two dynamic fields, which we created before.

ZendeskConncetor CreateTicket Response

Now we can configure our outgoing XSLT-mapping. If you need a working XSLT-mapping, you can use the following example:

ZendeskConnector CreateTicketMapping

You also need an XSLT-mapping for the incoming response data, because we need to store the Zendesk Ticket ID in two ways:

ZendeskConnector CreateTicket Response Mapping

The Zendesk Issue ID is stored in the dynamic field “ZendeskID” and is afterward shown in the OTRS TicketZoom.

For updating/comment on Tickets in Zendesk, we need to store the TicketID + the ending “.json” in the second dynamic field “ZendeskIDJSON”. With the <xsl:value-of> element we’re modifying the response value:

<xsl:value-of select=”concat(//issue/id, ‘.json’)”/>

The last point for this invoker is the used “Event trigger”. Just select one and you’re done with the first Invoker.

 

Configuring the Invoker “TicketUpdate”

The next invoker is “UpdateIssue”.  Select all the needed data for your outgoing requests (please don’t forget the dynamic field “ZendeskIDJSON” in the “Ticket dynamic fields” dropdown) and use “XSLT” as a mapping for your outgoing data.

ZendeskConnector UpdateTicketZendeskConnector UpdateTicket

As outgoing XSLT-mapping you can use my example:

ZendeskConnector UpdateTicket Mapping

A mapping for the incoming response data is not necessary, but maybe a good idea. ;-)

The last point for this invoker is the used “Event trigger”. Just select one and you’re done with the second Invoker.

Configuring the Invoker “TicketGet”

The next invoker is “TicketGet”.  The only field we need is the dynamic field “ZendeskIDJSON”, because we want to receive the latest data from Zendesk.

ZendeskConnector TicketGetZendeskConnector TicketGet

As outgoing XSLT-mapping you can use my example:

ZendeskConnector TicketGet Outgoing Mapping

We need a mapping for the incoming response data because we want to show some values in OTRS. In my example I want to see the latest Zendesk ticket state in OTRS:

GetIssue Inbound mapping RedmineConnector

The last point for this invoker is the used “Event trigger”. Just select one and you’re done with the next Invoker.

 

Configuring the “Network Transport”

It’s necessary to configure the network transport because we’ve to use the right requests commands towards Zendesk. But it’s quite easy as you can see:

ZendeskConnector Transport Config

It’s important to use “BasicAuth” as an authentication module. Please use a valid Zendesk user for authentication!

Afterward just click on “Save and finish”.

Testing the ZendeskConnector

Finally, we can do some tests. Just create or take an already existing ticket and trigger the “TicketCreate” Invoker.

As result you should see something similar in the OTRS Debugger:

Debugger TicketCreateDebugger TicketCreate

In Zendesk you’ll now see this Incident:

Zendesk Ticket

If we now trigger the Invoker “TicketUpdate” we’ll see the following in the Debugger:

Debugger TicketUpdate

As a result, a new comment is added to the ticket in Zendesk. This is also visible in the Zendesk comment section:Zendesk Updated Ticket

And the last the Invoker “TicketGet”:

Debugger TicketGet

We should now see the Zendesk ticket state in OTRS.

OTRS ZendeskState

Further thoughts

The invoker “TicketGet” can be triggered regularly. For example with the freely selectable OTRS Business Solution™ feature “Advanced GenericAgent”. This feature allows relative timestamps for date/datetime dynamic fields.

More information about the Zendesk API

You can also use other resources which are provided by the Zendesk Core API.

Please go to the following website, if you need more information: https://developer.zendesk.com/rest_api/docs/core/introduction

 

Exported web service configuration

I’ve uploaded the web service configuration. You can download it directly from this blog article. :-)

ZendeskConnector

#2
Robert Ullrich at 26.07.2017, 17:19

Hi Carlos, thank you very much for your feedback! I've attached the webservice configuration to this article :-)

#1
Carlos Fernando Rodríguez Hernández at 25.07.2017, 18:05

Would be great to post the export of your web service so other admins can import on their systems and have a base to work with

Your email address will not be published. Required fields are marked *

This site uses cookies. By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close