Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Routing alerts in Opsgenie using Jira Service Desk custom fields

This article explains how you can route alerts in Opsgenie to specific teams using values from custom fields in Jira Service Desk.

Please Note: This document covers only the cloud version of Jira Service Desk.

Sample Scenario

For demonstration purposes, let's consider a scenario where there is a custom field in Jira Service Desk (JSD) which has dropdown fields showing specific teams. When a user creates a ticket in JSD, they will be able to select which team is responsible for actioning the ticket. Let’s say, a ticket was created for printer maintenance. The user selects IT from the custom field “Department”. The goal is to create an alert in Opsgenie and route it to the IT team and alert the on-call engineer.

Image 2019-11-25 at 1.38.39 pm.png


First let's assume that there are teams created in Opsgenie with the corresponding on-call schedules. We will also assume that the JSD integration is set up in Opsgenie and that alerts are successfully created for tickets created in JSD. Here is one way to route alerts based on custom fields. 

  1. First, find the ID of the custom field in JSD. If you don't know how to find it, check out this article.

  2. Under the "Advanced" tab in the integration options enter the label name and value as shown in the screenshot below. In this case, the value is entered as {{_payload.issue.fields.customfield_10117.value}} where customfield_10117 is the ID of the dropdown field. If your custom field is an array, then you need to retrieve data using format “customfield.get(0)”. For more information on working with string processing methods click here. You can also refer to the dynamic field string processing documentation here.Image 2019-11-25 at 9.08.23 pm.png

  3. When the above settings are applied, new alerts are created with the custom field values populated under the alert’s extra properties.
  4. A screenshot of a sample alert's extra field properties is shown below.
    Image 2019-11-25 at 9.18.31 pm.png
  5. Once this is achieved, we can now navigate to Opsgenie → Teams →. Select the desired team and define the routing rules. In this example, we want to route alerts created with the “Department” value as “IT” so that it's routed to the IT team.
  6. Click on “Add routing rule” under Teams → On-call and then define routing rule as shown below:Image 2019-11-25 at 9.23.31 pm.png
  7. Once this is saved, the routing rule will look like the screenshot below. Here, if the Department value is IT, Opsgenie will route the alert to the IT team schedule, otherwise the alert will be routed to the team’s default schedule.Image 2019-11-25 at 9.26.39 pm.png


It'd be good if an example is given with the array-type fields.

Like Brent Jones likes this

As a correction for this post since it's been almost one year ago, there are some changes to fetch the custom fields.

Here is the way I adjust my settings of the Create Alert For Next-Gen Projects rule of my Jira Service Desk Cloud integration to print out the full payload in the Description field by adding the {{_payload}} and extract my text-based custom field, Affected Environment (its ID is 10112) to be added into the extra properties section.



Image 2020-11-03 at 9.22.53 am.png


Image 2020-11-03 at 9.23.09 am.png


And here is the result.

Image 2020-11-03 at 9.23.46 am.png

Like Ronnie Kingston likes this


Log in or Sign up to comment
Community showcase
Published in Opsgenie

Leveraging Atlassian’s Opsgenie and AWS Cloudformation Registry to stay ahead of incidents

In the past, managing IT infrastructure was a hard job. It required a lot of manual effort and it was hard to keep track of all the necessary information (monitoring, scalability etc). Thankfully, as...

1,856 views 0 11
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you