In this page

Overview

HTTP requests provide a standard, powerful and simple way to send messages to an external server over the network. They can be used to update external applications, send real-time alerts to external consumers, trigger CI builds, or even deploy to the production server.

This technique is extremely universal, because it enables integrating any tool which offers a REST API to your automations! To name a few:

...and a lot more. Just check out the documentation of the tool you want to integrate with!

Sending an HTTP request after every changeset

This automation sends an HTTP(S) request to a URL when a new changeset is received:

Configuration

This guide uses the a dead-simple webhook provided by the Webhook.site platform to explain the configuration steps. You can implement the automation for any HTTP request based on this guide, just use a different URL and request configuration settings.

  1. Create the test webhook:
    1. Open the Webhook.site page in your browser. It will generate a unique test webhook for you, identified by a URL like this (shown at Your unique URL, you will need it later!):
      https://webhook.site/47e0c9d2-7324-4995-b5b9-782185267e6d
    2. Keep the page open as you will see the incoming HTTP requests here later.
  2. Create the automation rule:
    1. Login to Jira as admin, go to AdministrationSystemAutomation rules.
    2. Click Create rule.
    3. Select the trigger Changeset accepted (from the DevOps category).
    4. Click Save.
    5. Click New action.
    6. Select the action Send web request.
      1. Enter the webhook URL:
        https://webhook.site/47e0c9d2-7324-4995-b5b9-782185267e6d
        Notes:
        • See the action's documentation for configuring the HTTP method, HTTP headers and the request body (payload).
    7. Click Save.
    8. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a commit with this commit message:
    Fix the FOO-1 bug.
  2. The HTTP request will be received and shown by the Webhook.site page.

Troubleshooting

If you don't get the expected results:

  1. See the general troubleshooting steps.

Sending an HTTP request with a specific command

This automation sends an HTTP(S) request to a URL, optionally parsing request parameters from the VCS commit message and passing those in the request.

Configuration

Note that the default command @call used in this guide doesn't have a concrete purpose. It was primarily designed to demonstrate how to send an HTTP request and to serve as a template for concrete commands.

After you understood how it works, you can customize it to a concrete use case by:

  1. Modifying its name (e.g. @review).
  2. Modifying its description (e.g. "Pass the user story to code review.").
  3. Modifying its parameter pattern (e.g. no parameters expected).
  4. Modifying its logic (e.g. transitioning the issue to "Waiting for review" and creating the pull request through the Bitbucket REST API).

This guide uses the a dead-simple webhook provided by the Webhook.site platform to explain the configuration steps. In the guide, a single number-type parameter foo is passed to the webhook to demonstrate using parameters. You can implement the automation for any HTTP request based on this guide, just use a different URL and request configuration settings.

  1. Create the test webhook:
    1. Open the Webhook.site page in your browser. It will generate a unique test webhook for you, identified by a URL like this (shown at Your unique URL, you will need it later!):
      https://webhook.site/47e0c9d2-7324-4995-b5b9-782185267e6d
    2. Keep the page open as you will see the incoming HTTP requests here later.
  2. Create the automation rule:
    1. Go to AdministrationSystemAutomation rules.
    2. Click Create rule.
    3. Select the trigger Genius Commit created (from the DevOps category).
    4. Choose the command Call REST API, and click Save.
    5. Click New action.
    6. Select the action Send web request.
      1. Enter the webhook URL and refer the parameter as {{devops.reqparam}}:
        https://webhook.site/47e0c9d2-7324-4995-b5b9-782185267e6d?foo={{devops.reqparam.urlEncode}}
        Notes:
        • The request parameters in the URL should be URL-encoded with .urlEncode.
        • See the action's documentation for configuring the HTTP method, HTTP headers and the request body (payload).
    7. Click Save.
    8. Name your automation rule intuitively, and click Turn it on.

Usage

  1. Create a commit with this commit message:
    Fix the FOO-1 bug. @call 123
  2. The HTTP request will be received with the foo=123 query parameter and shown by the Webhook.site page.

Troubleshooting

If you don't get the expected results:

  1. Check if the @call command is defined in the Genius Commands screen?
  2. Check if the @call command followed by the parameter was included in the commit message?
  3. See the general troubleshooting steps.

Questions?

Ask us any time.