• Products
  • Get started
  • Documentation
  • Resources

Integrate Opsgenie with Jira Service Management

What does Opsgenie offer Jira Service Management users?

Opsgenie provides a powerful two-way integration with Jira Service Management. When a new issue is created in Jira Service Management, a corresponding Opsgenie alert is automatically created, containing rich information about the issue. Opsgenie provides rich notifications with on-call rotations, scheduling features, and alert escalations to ensure the best alert and incident management for Jira Service Management customers. As users execute actions on the alerts, like acknowledge or snooze, the issue in Jira Service Management automatically updates with comments about these alert actions. If users close the alert, the issue in Jira Service Management is resolved (Only if the issue has a Resolve the issue transition).

Functionality of the integration

Jira Service Management to Opsgenie:

  • When an issue is created in Jira Service Management, an alert is created in Opsgenie.

  • When a comment is added to issue in Jira Service Management, the same comment is added as a note to the alert in Opsgenie.

  • When an issue is closed and resolved in Jira Service Management, the alert in Opsgenie is closed.

Opsgenie to Jira Service Management:

  • If Send Alert Updates Back to Jira Service Management is enabled, actions for Jira Service Management are executed in Jira Service Management when the chosen action is executed in Opsgenie for alerts which are created by the Jira Service Management integration.

  • If Create Jira Service Management Issues for Opsgenie Alerts is enabled, actions for Jira Service Management are executed in Jira Service Management when the chosen action is executed in Opsgenie for alerts which have a source other than the Jira Service Management integration.

  • This action mapping features are explained in detail in the Action Mapping Feature section below.

Adding Jira Service Management Integration in Opsgenie

If you're using Opsgenie's Free or Essentials plan or if you’re using Opsgenie with Jira Service Management's Standard plan, you can add this integration from your team dashboard only. The Integrations page under Settings is not available in your plan.

  1. Go to Teams and select your team.

  2. Select Integrations on the left navigation and then select Add integration.

Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only. Follow the rest of the steps in this section to set up the integration.

  1. Go to Settings > Integrations. Search for Jira Service Management and select Add.

  2. Specify who is notified of Jira Service Management alerts using the Responders field. Auto-complete suggestions are provided as you type.

  3. Copy the integration URL to use in the Jira Service Management configuration.

  4. Click Save Integration.

Using SSO?

If you are using SSO to log in to Jira, you need to generate an API token and use this token as the password in the integration settings. Visit Manage API tokens for your Atlassian account to learn how to generate an API token in Jira.

After generating your new token, copy and paste it to the Password field of the Jira integration in Opsgenie. Then, save the integration.

 

Users who don't have Atlassian Account

Users who are authenticating against the REST API but do not have Atlassian Accounts, need to convert them to Atlassian Account. You can check here to see the instructions to convert Atlassian Account.

Action Mapping Feature

  • Opsgenie allows customers to define action mappings between Opsgenie actions and Jira Service Management actions.

  • To use the Action Mappings feature, provide some information to the integration which are listed below:

  • Issue Type Name: The issue types defined in Jira Service Management e.g. Task, IT Help, Sub-task, Service Request or any other custom defined type. Make sure you write the issue type syntax error-free.

  • Jira Service Management URL: This is the domain name of your service e.g. https://testops.atlassian.net

  • Username: The e-mail address you use to login to Jira Service Management.

  • Password/API Token: The password or API token you use to login to Jira Service Management.

  • Project Key: The key of the project you want to create alerts from e.g. OT, OPS, SIT. The project key is usually in capital letters so make sure you write it in the right form.

For alerts created by Jira Service Management

  • You can use this section to map Opsgenie actions to Jira Service Management actions when the source of the alert is Jira Service Management (i.e When the alert is created by Jira Service Management integration.)

  • You can map different Opsgenie actions to different Jira Service Management actions. For example, you can add note to Jira Service Management issue, when the alert is acknowledged. In order to do this, you should define If alert is acknowledged in Opsgenie, add it as a comment to the issue in Jira Service Management. mapping in Send Alert Updates Back to Jira Service Management section.

A screenshot showing the action mapping in for alerts created by JSM checkbox.

For other Opsgenie alerts

  • You can use this section to map Opsgenie actions to Jira Service Management actions when the source of the alert is NOT Jira Service Management (i.e When the alert is created by another integration.)

  • For this purpose, you can use Create Jira Service Management Issues for Opsgenie Alerts section. In order to use this functionality, you need to map one Opsgenie action to create an issue Jira Service Management action. The Opsgenie action doesn't have to be alert is created, it can be other actions as well.

  • a tag is added to the alert and a custom action is executed on alert actions differ from other actions. When one of these actions is selected, an extra field is added to enter for which tags or for which custom action this mapping works.

  • Enter multiple tags by separating the tags with a comma. If multiple tags are entered, the mapping works if the alert has one or more of the specified tags. For the mapping to work for any tag, leave the tags field empty.

  • If an Opsgenie action is mapped to multiple Jira Service Management actions, an error occurs except for the a tag is added to the alert and a custom action is executed on alert actions. Save multiple mappings for these actions because they differ by the given tags and the given custom action names.

A screenshot showing the action mapping for, for other Opsgenie alerts checkbox.

Configuration in Jira Service Management

  1. Log in to Jira as an administrator.

  2. From the dashboard, open the Administration menu. Select System.

  3. From the left, select Webhooks under "Advanced".

A screenshot showing accessing webhooks from JSM for Opsgenie integration.

4. Click Create A Webhook. In the opening section, paste the URL provided by Opsgenie's Jira integration into URL input. Click Create.

5. Make sure Exclude body checkbox is not selected.

A screenshot that shows the exclude body checkbox in JSM webhook listener.
A screenshot showing how to create a webhook from JSM for Opsgenie integration.

Now manage your Jira Service Management alerts at Opsgenie and leverage its full alerting functionality.

Sample payload sent from Jira Service Management

Create Alert payload:

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 { "issue": { "id": "10042", "self": "https://test.atlassian.net/rest/api/2/issue/10042", "key": "TEST-43", "fields": { "issuetype": { "self": "https://test.atlassian.net/rest/api/2/issuetype/10000", "id": "10000", "description": "For system outages or incidents. Created by JIRA Service Management.", "iconUrl": "https://test.atlassian.net/servicedesk/issue-type-icons?icon=incident", "name": "Incident", "subtask": false }, "timespent": null, "project": { "self": "https://test.atlassian.net/rest/api/2/project/10000", "id": "10000", "key": "TEST", "name": "Test", "avatarUrls": { "48x48": "https://test.atlassian.net/secure/projectavatar?avatarId=10324", "24x24": "https://test.atlassian.net/secure/projectavatar?size=small&avatarId=10324", "16x16": "https://test.atlassian.net/secure/projectavatar?size=xsmall&avatarId=10324", "32x32": "https://test.atlassian.net/secure/projectavatar?size=medium&avatarId=10324" } }, "fixVersions": [], "aggregatetimespent": null, "resolution": null, "customfield_10027": { "id": "1", "name": "Time to resolution", "_links": { "self": "https://test.atlassian.net/rest/servicedeskapi/request/10042/sla/1" }, "completedCycles": [ { "startTime": { "iso8601": "2016-06-27T11:25:37+0300", "jira": "2016-06-27T11:25:37.877+0300", "friendly": "Today 11:25 AM", "epochMillis": 1467015937877 }, "stopTime": { "iso8601": "2016-06-27T11:37:33+0300", "jira": "2016-06-27T11:37:33.572+0300", "friendly": "Today 11:37 AM", "epochMillis": 1467016653572 }, "breached": false, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 715695, "friendly": "11m" }, "remainingTime": { "millis": 13684305, "friendly": "3h 48m" } } ], "ongoingCycle": { "startTime": { "iso8601": "2016-06-27T16:01:45+0300", "jira": "2016-06-27T16:01:45.920+0300", "friendly": "Today 4:01 PM", "epochMillis": 1467032505920 }, "breachTime": { "iso8601": "2016-06-28T12:01:45+0300", "jira": "2016-06-28T12:01:45.920+0300", "friendly": "28/Jun/16 12:01 PM", "epochMillis": 1467104505920 }, "breached": false, "paused": false, "withinCalendarHours": true, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 197118, "friendly": "3m" }, "remainingTime": { "millis": 14202882, "friendly": "3h 56m" } } }, "customfield_10028": { "id": "2", "name": "Time to first response", "_links": { "self": "https://test.atlassian.net/rest/servicedeskapi/request/10042/sla/2" }, "completedCycles": [ { "startTime": { "iso8601": "2016-06-27T11:25:37+0300", "jira": "2016-06-27T11:25:37.877+0300", "friendly": "Today 11:25 AM", "epochMillis": 1467015937877 }, "stopTime": { "iso8601": "2016-06-27T11:37:33+0300", "jira": "2016-06-27T11:37:33.572+0300", "friendly": "Today 11:37 AM", "epochMillis": 1467016653572 }, "breached": false, "goalDuration": { "millis": 14400000, "friendly": "4h" }, "elapsedTime": { "millis": 715695, "friendly": "11m" }, "remainingTime": { "millis": 13684305, "friendly": "3h 48m" } } ] }, "resolutiondate": null, "workratio": -1, "lastViewed": "2016-06-27T16:01:46.447+0300", "watches": { "self": "https://test.atlassian.net/rest/api/2/issue/TEST-43/watchers", "watchCount": 1, "isWatching": true }, "created": "2016-06-27T11:25:37.859+0300", "customfield_10020": "Not started", "customfield_10021": null, "customfield_10022": null, "priority": { "self": "https://test.atlassian.net/rest/api/2/priority/3", "iconUrl": "https://test.atlassian.net/images/icons/priorities/medium.svg", "name": "Medium", "id": "3" }, "customfield_10023": [], "customfield_10024": null, "customfield_10025": null, "labels": [], "customfield_10026": null, "customfield_10016": null, "customfield_10017": null, "customfield_10018": null, "customfield_10019": null, "timeestimate": null, "aggregatetimeoriginalestimate": null, "versions": [], "issuelinks": [], "assignee": null, "updated": "2016-06-27T16:05:02.852+0300", "status": { "self": "https://test.atlassian.net/rest/api/2/status/10001", "description": "This was auto-generated by JIRA Service Desk during workflow import", "iconUrl": "https://test.atlassian.net/images/icons/status_generic.gif", "name": "Waiting for support", "id": "10001", "statusCategory": { "self": "https://test.atlassian.net/rest/api/2/statuscategory/1", "id": 1, "key": "undefined", "colorName": "medium-gray", "name": "No Category" } }, "components": [], "timeoriginalestimate": null, "description": "test description", "customfield_10010": null, "customfield_10011": null, "customfield_10012": null, "customfield_10013": null, "customfield_10014": null, "timetracking": {}, "customfield_10015": null, "customfield_10007": "0|i0009b:", "customfield_10008": "com.atlassian.servicedesk.plugins.approvals.internal.customfield.ApprovalsCFValue@cf82e6", "attachment": [], "customfield_10009": null, "aggregatetimeestimate": null, "summary": "New Summary", "creator": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "customfield_10000": null, "aggregateprogress": { "progress": 0, "total": 0 }, "customfield_10001": null, "customfield_10002": null, "customfield_10003": null, "environment": null, "duedate": null, "progress": { "progress": 0, "total": 0 }, "comment": { "comments": [ { "self": "https://test.atlassian.net/rest/api/2/issue/10042/comment/10027", "id": "10027", "author": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "body": "test comment", "updateAuthor": { "self": "https://test.atlassian.net/rest/api/2/user?username=admin", "name": "admin", "key": "admin", "emailAddress": "email@emailserver.tld", "avatarUrls": { "48x48": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=48", "24x24": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=24", "16x16": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=16", "32x32": "https://secure.gravatar.com/avatar/asd0a6bb5e5c8ce4c5152b54b45ee5c?d=mm&s=32" }, "displayName": "Administrator", "active": true, "timeZone": "Europe/Helsinki" }, "created": 1467032702852, "updated": 1467032702852 } ], "maxResults": 1, "total": 1, "startAt": 0 }, "votes": { "self": "https://test.atlassian.net/rest/api/2/issue/TEST-43/votes", "votes": 0, "hasVoted": false }, "worklog": { "startAt": 0, "maxResults": 20, "total": 0 } } }, "timestamp": 1467032703044 }

Integration via OEC (for On Premise Jira Service Management Usage)

Jira Service Desk is now Jira Service Management! The product name may have changed, but we'll continue using the old name (Jira Service Desk) in the scripts until the next update.

Use Opsgenie's OEC and the Jira ServiceDesk script to update requests on Jira Service Management. This enables the deployment of your own scripts/ability to modify the ones provided and execute customized actions on Jira Service Management.

To use the Jira ServiceDesk integration package, follow the steps in the sections below through the end.

Download the latest version of OEC

To download the latest version of JiraServiceDesk package, please use readme file of oec-scripts repository.

 

Installation

For Red Hat Based Distributions

  • Run following command : rpm -i opsgenie-jiraservicedesk-<your_version>.rpm

For Debian Based Distributions

  • Run following command : dpkg -i opsgenie-jiraservicedesk-<your_version>.deb

For Windows

  • Unzip opsgenie jiraservicedesk zip file which contains OEC package into a directory (C:\opsgenie is the preferred path.) Follow the instructions here to install OEC on Windows.

  • In order to learn more about how to run OEC you can refer to the Running OEC documentation.

Configuring Jira Service Management Integration for OEC

  • In order to use OEC utility, enable Send Via OEC.

  • Other configurations regarding Jira Service Management can be done either via integration page or OEC configuration file config.json. The configuration via the integration page precedes the configuration file.

A screenshot showing where to do other configurations in Opsgenie's JSM integration.

OEC Configuration

To be able to execute actions in Jira, OEC gets the configuration parameters from the configuration file located at path /home/opsgenie/oec/conf/config.json.

Configuration parameters

  • apiKey – Copy the API key from the Jira integration you've created above.

  • issueTypeName – Type of the issue which can be "Task", "Bug", "Story" or your custom issue type ("Epic" is not supported).

  • url – Your Jira Service Management url where issues will be created, resolved, closed etc.

  • username – Your username for your Jira Service Management account.

  • password – Your password for your Jira Service Management account.

  • key – The issues will be created for this project.

The package that you downloaded also includes OEC utility which is located under /usr/local/bin and the script that is needed to be run by OEC which is under /home/opsgenie/oec/scripts. After the configuration of OEC is done, you need to run it. In order to learn more about how to run OEC, you can refer to the Running OEC documentation.

Sample parameters sent to OEC

JSON

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "summary":"test", "issueTypeName":"Task", "integrationName":"Jira Service Management", "sendViaOEC":true, "description":"this is a test", "integrationId":"3af28c92-b71c-459c-8d72-04a6f7f7ebac", "url":"https://jiratestopsgenie.atlassian.net", "password":"******", "projectKey":"OPSGENIE", "integrationType":"JiraServiceDesk", "customerId":"04912a27-5fc1-4145-a6dd-8819afc0d870", "alias":"c570a4cc-3f57-4b60-814e-f04c63e7442d", "action":"Create", "alertId":"c570a4cc-3f57-4b60-814e-f04c63e7442d", "key":null, "mappedAction":"createIssue", "username":"jiratest@opsgenie.com" }

Troubleshooting

  1. If a mandatory custom field is set for creating an issue in Jira Service Management, a Jira Service Management issue cannot be created from an Opsgenie alert. However, by using OEC and configuring the script, the creation of Jira request can be achieved.

  2. If a comment cannot be added to an issue by performing an action on an alert, please look at the Logs page first. If the URL does not contain the issue key it means there is no issue in Jira ServiceManagement populated from that alert. Thus it could not add a comment to a non-existing issue.

  3. Opsgenie's Jira Service Management integration allows setting the status of the issue to RESOLVED in Jira Service Management. However, if the workflow of the project does not allow that transitions, you cannot set that transition using Opsgenie too.

  4. Jira Service Management does not support non-ASCII characters. Having non-ASCII characters on payload to be sent to Jira Service Management may cause 400 Bad Request Error.

  5. If the Jira Service Management integration is assigned to a team, in order to create issues in Jira Service Management from alerts created in Opsgenie, the other integrations must also be assigned to the same team, or, no team must be assigned for both the Jira Service Management integration and the other Opsgenie integrations.

  6. If you receive a Reason: 400 Bad Request error in the activity logs after attempting to create a Jira Service Management request from an Opsgenie alert, check the Logs page for detailed information on this response. An example pf the error you may see in the Logs page is: "labels":"Field 'labels' cannot be set. It is not on the appropriate screen, or unknown". To resolve this go to your Jira Service Management account and add the missing field from project settings.

Still need help?

The Atlassian Community is here for you.