Last updatedJul 17, 2019

Automation webhooks

Apps and applications can react to conditions/events in Jira Service Desk via automation rules. An automation rule triggers an action when an event occurs or a condition is reached. This page describes how to configure an automation rule to fire a webhook that notifies your app or application. For example, you might use a webhook to alert your remote application when an SLA is about to be breached.

Alternatively, if you want an automation rule to directly trigger an action in a remote system, you can implement an "automation action" (i.e. a custom THEN action). For details, see Guide - Implementing automation actions.

Overview

In addition to webhooks in Jira platform, the automation engine of Jira Service Desk can trigger webhooks as part of configured automation rules.

When you configure a rule, you can specify WHENs and IFs, then use the webhook to define your action. For example, this image shows a rule that uses a webhook to page second-level support when a "Time to Resolution" SLA is about to breach: Screenshot of automation rule

Adding a webhook to an automation rule

  1. Navigate to Project settings, Automation, then create a Custom rule or edit an existing rule.
  2. Configure the WHEN and IF settings as desired, then add a THEN action and choose Webhook. Screenshot of rule edition
  3. Configure the webhook settings, name your rule, and save it.

Webhook settings

  • URL -- In Jira Service Desk Cloud, use port 80 for "http://" URLs and port 443 for "https://" URLs.

  • Include payload -- If you choose the Include payload in request body option, a JSON object containing the action details is attached to the request body.

The JSON payload of the request will contain the following fields:

  • timestamp
    • Time the webhook payload was created in milliseconds.
  • issue
    • The Jira representation of the issue. This is the same shape returned by the Jira REST API.
  • comment
    • The Jira representation of the comment (if it is available). This is the same shape returned by the Jira REST API.
  • user
    • The Jira representation of the user (if it is available). This is the same shape returned by the Jira REST API.
  • action
    • Contains details about the action that was triggered. This includes the action configuration that was saved previously.

The information in the payload is generated by the user who runs the automation rule. This user can be configured as the Project Default or the user who triggers the rule. If the user does not have permission to see some fields, then those values do not render. See Automating Your Service Desk for more info.

Webhook execution

  • Request method -- When a webhook THEN action triggers, Jira fires an HTTP POST request to the URL you configured.
  • Success criteria and timeout -- A webhook HTTP POST request is considered successful if the server returns a response with status code range 200 (inclusive) to 300 (exclusive). Jira Service Desk waits 5 seconds to establish a TCP connection with the webhook server, and 20 seconds for a response after connection is established. If the webhook requests fails, Jira Service Desk does not retry the connection.
  • Asynchronous webhook execution -- The webhook THEN action is executed asynchronously. If many executions are triggered in a short period of time, they are queued and executed one at a time without blocking the other automation rules you have in Jira Service Desk.

    Guide - Implementing automation actions: /cloud/jira/service-desk/guide-implementing-automation-actions

    Overview: #overview

    Adding a webhook to an automation rule: #adding-a-webhook-to-an-automation-rule

    Webhook settings: #webhook-settings

    Webhook execution: #webhook-execution

    webhooks in Jira platform: /cloud/jira/platform/webhooks