How to connect OTRS with PagerDuty

Robert Ullrich19. Apr 2017 | ConsultingUse cases

With the OTRS Business Solution™ 5s you have the possibility to create, acknowledge and resolve incidents in PagerDuty. The following article will explain how to configure the PagerDutyConnector to establish a connection between OTRS and PagerDuty.

To complete this Howto you need a PagerDuty account. Furthermore you need to configure a new service with the Integration Type “Use our API directly”. After that you’re ready to create Incidents via webservice in Pagerduty. ;-)

 

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 „PagerdutyID“ of type „TEXT“

 

Configuring the “PagerDutyConnector”

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

The name of the new webservice could be “PagerDutyConnector”:

 

General settings of the PagerdutyConnector

General settings of the PagerdutyConnector

 

Configuring the Invoker “Create_Incident”

So we’re ready to start configuring our Invokers. The first Invoker is “Create_Incident”.  Select all the needed data for your outgoing requests and use “XSLT” as a mapping for your outgoing data.

General setup of the invoker Create_Incident for PagerdutyConnector

If you need a working XSLT-mapping, you can use the attached one. The only thing you have to add is your personal “routing_key”.

Mapping for the outgoing data of the PagerdutyConnector

You also need a XSLT-mapping for the incoming response data, because we need to store the “dedup_key”. Use my mapping, if you need a working example.

Mapping for the incoming response data

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

 

Configuring the Invoker “Acknowledge_Incident”

The next invoker is “Acknowledge_Incident”.  Select all the needed data for your outgoing requests and also use “XSLT” as a mapping for your outgoing data.

Acknowledge Incident Mapping for the PagerdutyConnector

If you need a working XSLT-mapping, you can use the attached mapping. As before you only need your personal “routing_key”.

Acknowledge Incident Mapping for the PagerdutyConnector

You don’t need a mapping for the incoming data. PagerDuty only responds with a status, a message and the dedup_key.

 

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

 

Configuring the Invoker “Resolve_Incident”

The last invoker is “Resolve_Incident”.  Select all the needed data for your outgoing requests and also use “XSLT” as a mapping for your outgoing data.

Resolve Incident configuration of the PagerdutyConnector

If you need a working XSLT-mapping, you can use the attached mapping. As before you only need your personal “routing_key”.

Resolve Incident Mapping for the PagerdutyConnector

As before you don’t need a mapping for the incoming data. PagerDuty only responds with the status, a message and the dedup_key.

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

Configuring the “Network Transport”

Furthermore we need to configure the network transport. But it’s quite easy as you can see:

Network transport configuration of the PagerdutyConnector

Afterwards just click on “Save and finish”.

 

Testing the “PagerDutyConnector”

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

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

In PagerDuty you’ll now see this Incident:

If we now trigger the Invoker “Acknowledge_Incident” we should receive a status “success”:

As a result the status changed from “Triggered” to “Acknowledged” in PagerDuty:

And at last the Invoker “Resolve_Incident”:

Finally the incident is also “resolved” in PagerDuty:

More information

You can also use other resources which are provided by PagerDuty.

Please go to the following website, if you need more information: https://v2.developer.pagerduty.com/docs/rest-api

 

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