Assign Jira Work Items to Alert Acknowledgers in OpsGenie

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Learn how to automatically assign Jira tickets to users who acknowledge OpsGenie alerts using Jira automation and integration.

Solution

Part 1: Setting up Jira Service Management Sync integration

  1. Go to Teams > Select your team > Select Go to operations > Select Sync.

    1. Create a Sync integration with the desired Project, if you already don’t have one.

  2. Under Rules for taking actions against alerts make sure that "Update work items against alerts created by this sync" checkbox is selected.

  3. Map the integration to add a comment on the ticket when the alert is acknowledged. It should be there by default however, if it is not, click on Add update rule and add the action such as:

    1. If alert is acknowledged in Jira Service Management, add comment to work item.

Sync settings for project JA show rules for alert creation, processing, and actions. Alerts can trigger work item updates in JSM. Options include adding comments when alerts are acknowledged, closed, or have notes added.

Part 2: Configure an automation rule in JSM to filter the username from comments added in part 1 and assign the tickets accordingly

For the automation rule to work as expected the name of the user needs to be unique

In Jira go to the project connected to the Sync integration and click on Project Settings > Automation and follow the below instructions:

Automation rule overview

  • Trigger: When a comment is added to Jira work item.

  • Conditions:

    • If user who added the comment is the same user configured for the Sync integration in our case the user is (System).

    • If the comment body contained "acknowledged alert".

  • Actions:

    • Extract the user name value from the comment body using text manipulation - Reference: Jira smart values - text fields.

    • Save the user name into a variable.

    • Send an API request to get the user name account ID (To update the Assignee user picker field the value must be the account ID for the user not their display name).

    • From the web response body extract the account ID.

    • Set the assignee field with the value of the account ID.

Parameters used in the automation rule

  • In the Create Variable action set the {{modifiedcomment}} variable to the below value:

{{issue.comment.last.body.substringBetween("[Sync] "," acknowledged")}}
  • Send web request action parameters:

    • URL: https://<Your-Site-Name>/rest/api/2/user/search?query={{modifiedcomment.urlEncode}}

    • Headers:

      • Authorization - Reference Link to generate the Authorization token Automation for Jira - Send web request using Jira REST API.

      • Once the token is generated convert it to base64 using the below steps:

        How to convert to Base 64

        We need to encode the credentials "<EMAIL>:<API_TOKEN>with base64. We can make this through any online tool like Base64 encode. Note: Make sure not to include a line break at the end.

        Apart from that, it's possible to Encode to base64 through terminal:

        $ echo -n "email@example.com:<YOUR_TOKEN_HERE>" | base64

      • Use base 64 in the authorization header.

      • Content-Type - application/json.

    • Under Wait for response click on the checkbox for Delay execution of subsequent rule actions until we've received a response for this web request.

  • In the edit action for assign select smart value and set it to the following: {{webResponse.body.first.accountId}}.

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.