JIRA Service Desk Integration

JIRA Service Desk is a collaborative IT service desk with a powerful ticketing system, a self-service knowledge base and real-time reporting. OpsGenie is an alert and notification management solution that is highly complementary to JIRA Service Desk.

​What does OpsGenie offer to JIRA Service Desk users?

OpsGenie provides a powerful two-way integration with JIRA Service Desk. When a new issue is created in JIRA Service Desk, a corresponding OpsGenie alert will be automatically created, containing rich information about the issue. OpsGenie will provide rich notifications with on-call rotation, scheduling etc. features and alert escalations; to ensure the best ticket management for JIRA Service Desk customers. As users execute actions on the alerts, like acknowledge, snooze, the issue on JIRA Service Desk will also automatically be updated with comments about these alert actions. And if users choose to close the alert, the issue on the JIRA Service Desk will be resolved (Only if the issue has a Resolve the issue transition, it will be resolved).


Functionality of the integration

JIRA Service Desk to OpsGenie:
  • When an issue is created in JIRA Service Desk, an alert will be created in OpsGenie.
  • When a comment is added to issue in JIRA Service Desk, same comment will be added as a note to the alert in OpsGenie.
  • When an issue is closed and resolved in JIRA Service Desk, the alert in OpsGenie will be closed.
OpsGenie to JIRA Service Desk:
  • If Send Alert Updates Back to JIRA Service Desk is enabled, actions for JIRA Service Desk will be executed in JIRA Service Desk when the chosen action is executed in OpsGenie for alerts which are created by the JIRA Service Desk integration.
  • If Create JIRA Service Desk Issues for OpsGenie Alerts is enabled, actions for JIRA Service Desk will be executed in JIRA Service Desk when the chosen action is executed in OpsGenie for alerts which have a source other than the JIRA Service Desk integration.
  • This action mapping features are explained in detail in the Action Mapping Feature section below.

Adding JIRA Service Desk Integration in OpsGenie

  1. Please create an OpsGenie account if you haven't done already
  2. Go to JIRA Service Desk Integration page
  3. Specify who should be notified for JIRA Service Desk alerts using the "Teams" field. Auto-complete suggestions will be provided as you type. 
  4. Copy the integration URL by clicking on the copy button. You'll be using this in the JIRA Service Desk configuration.
  5. Click "Save Integration".

Action Mapping Feature

  • OpsGenie allows customers to define action mappings between OpsGenie actions and JIRA Service Desk actions.
  • To be able to use the Action Mappings feature you should provide some information to the integration which are listed below:
    • Issue Type Name: The issue types defined in JIRA Service Desk 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 Desk URL: This is the domain name of your service desk e.g. https://testops.atlassian.net
    • Username: The e-mail address you use to login to JIRA Service Desk.
    • Password: The password you use to login to JIRA Service Desk.
    • 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 Desk
  • You can use this section to map OpsGenie actions to JIRA Service Desk actions when the source of the alert is JIRA Service Desk (i.e When the alert is created by JIRA Service Desk integration.)
  • You can map different OpsGenie actions to different JIRA Service Desk actions. For example, you can add note to JIRA Service Desk 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 Desk. mapping in Send Alert Updates Back to JIRA Service Desk section.

  • For other OpsGenie alerts
  • You can use this section to map OpsGenie actions to JIRA Service Desk actions when the source of the alert is NOT JIRA Service Desk (i.e When the alert is created by another integration.)
  • For this purpose, you can use Create JIRA Service Desk Issues for OpsGenie Alerts section. In order to use this functionality, you need to map one OpsGenie action to create an issue JIRA Service Desk 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 you select one of these actions, you'll see an extra field to enter for which tags or for which custom action this mapping will work.
  • You can enter multiple tags by separating the tags with a comma. If you enter multiple tags, the mapping will work if the alert has one or more of the specified tags. You can also leave the tags field empty, if you would like the mapping to work for any tag.
  • If you select a custom action mapping, you must specify the name of the custom action that the mapping will work. It cannot be left empty.
  • If you map an OpsGenie action to multiple JIRA Service Desk actions, you will get an error except for the a tag is added to the alert and a custom action is executed on alert actions. You can save multiple mappings for these actions, because they will differ by the given tags and the given custom action names.

Configuration in JIRA Service Desk

  1. In JIRA Service Desk dashboard, go to Project Settings.

  2. Click Automation.

  3. Click on Add Rule button on the right side of the screen.

  4. Select Custom Rule on list and click Next.

  5. Give a name to the rule e.g. OpsGenie
  6. Click Add Trigger on WHEN section
  7. Add Issue created, Issue resolution changed, Status change, Comment added and Comment edited.
  8. Click Add Action on THEN section
  9. Select Webhook and click Add
  10. Paste the OpsGenie JIRA Service Desk URL you copied from the previous section into URL field.
  11. Check Include payload in request body.
  12. Make sure enabled is checked and click Save button.

You can now manage your JIRA Service Desk alerts at OpsGenie and leverage its full alerting functionality.

Sample payload sent from JIRA Service Desk

Create Alert payload:

{
  "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 Desk.",
        "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
}

Troubleshooting

  1. If you set a mandatory custom field for creating an issue in JIRA ServiceDesk, you cannot create a JIRA ServiceDesk issue from an OpsGenie alert.
  2. If you cannot add comment to an issue by performing an action on an alert, please look at our Logs page first. If the url does not contain the issue key it means there is no issue on JIRA ServiceDesk which is populated from that alert. Thus it could not add a comment to a non-existing issue.
  3. OpsGenie JIRA ServiceDesk Integration allows you to set the status of the issue to RESOLVED in JIRA ServiceDesk. However, if the workflow of the project does not allow that transitions, you cannot set that transition using OpsGenie too.
  4. JIRA ServiceDesk does not support non-ASCII characters. Having non-ASCII characters on payload to be sent to JIRA ServiceDesk may cause 400 Bad Request Error.
  5. If the JIRA Service Desk integration is assigned to a team, in order to create issues in JIRA Service Desk 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 Desk integration, and the other OpsGenie integrations.