As I use Zammad as the helpdesk-system in my company, I was looking for a way to create alerts in PagerDuty for critical tickets in Zammad. I initially just forwarded the tickets by mail to PagerDuty which worked but was a kind of dirty approach. With the new option of using custom webhooks in Zammad, the integration is a little smoother.

On the PagerDuty-side, you need to have a service created. In the service itself, you need to enable the “Events API v2” integration. Make sure to take note of the “Integration Key” as this is needed during the setup in Zammad.

In Zammad, you need to setup a new Webhook in the system settings. The Endpoint requested in Zammad is the “Integration URL (Alerts)” from the Integration in PagerDuty. By-default that should be the following URL: https://events.pagerduty.com/v2/enqueue

The option “HMAC SHA1 Signure Token” is not used, the “SSL Verification” can be turned on (as long as you are not using a TLS-inspection proxy). The parameters for the “Basic Authentication” are not used and should be empty. Last but not least, make sure to enable the “Custom Payload” option which opens a text-box.

You can copy-paste the following code into the appeared code-box.

{
  "payload": {
    "summary": "[Ticket##{ticket.number}] #{ticket.title}",
    "source": "#{ticket.number}",
    "severity": "critical",
    "custom_details": {
      "ticket.number": "Ticket##{ticket.number}",
      "ticket.state": "#{ticket.state.name}",
      "ticket.type": "#{ticket.type}",
      "ticket.priority": "#{ticket.priority.name}",
      "ticket.group": "#{ticket.group.name}",
      "customer.fullname": "#{ticket.customer.fullname}",
      "organization.name": "#{ticket.organization.name}"
    }
  },
  "routing_key": "",
  "dedup_key": "#{ticket.number}",
  "links": [
    {
      "href": "https://support.level66.network/#ticket/zoom/#{ticket.id}",
      "text": "Open Ticket in Zammad"
    }
  ],
  "event_action": "trigger",
  "client": "Ticket System",
  "client_url": "https://support.level66.network/"
}

Make sure to adapt a few settings to your needs:

  • Set the “routing_key” to the “Integration Key” copied from PagerDuty.
  • Update the URL in the “links” and “client_url” to match your installation URL.
  • In case you are using a different Ticket-Hook/Prefix (default is: Ticket#), make sure to change that in the “summary” and “ticket.number” lines.

Now, you can use the Webhook in your Triggers to inform you on-call crew about critical tickets or monitoring event. Enjoy!