Skip to main content

Send incidents or alerts to Jira Service Management

Note

This procedure uses the alert webhook.

You can configure Moogsoft Cloud to create tickets in Jira Service Management using an Outbound Webhook integration.

Before you begin

Before you set up your Jira Service Management outbound integration:

  • Make sure you have an active Jira Service Management account.

  • Make sure you have a valid Jira API key that you can access and use with this integration.

    If you do not have a Jira API key, create a new one by following the steps in these instructions.

Set up outbound webhook in Moogsoft

  1. Within Moogsoft, navigate to Integrations >Outbound Integrations > Webhook (Legacy).

  2. Click Add a Webhook and complete each section according to the following:

    1. Name and Scope:

      1. Provide a unique name.

      2. Within the filter section, add conditions to control which incidents or updates are forwarded to Jira.

    2. CREATE Operations and HTTP Configuration:

      1. Set the request method as POST.

      2. Specify the Jira API endpoint URL.

        • To make a call to the v3 endpoint, use the following URL format:

          https://<yourDomain>.atlassian.net/rest/api/3/issue/
        • To make a call to the v2 endpoint, use the following URL format:

          https://<yourDomain>.atlassian.net/rest/api/2/issue/

        To learn about the differences between Jira API v2 and Jira API v3, see the Jira Cloud documentation.

      3. Under Authorization, select "Basic Auth" from the dropdown menu.

        1. Click Add New Credentials.

        2. Within the window that appears, enter a unique name for your Jira credentials.

        3. Enter your Jira username and password.

        4. Click Save.

    3. Payload Body for CREATE Operation:

      1. The example payload body for this step will vary depending on which version of the Jira API endpoint you are using (v2 or v3). For more information, see the Jira Cloud documentation.

        • If you are using the v3 endpoint, copy and paste the following example payload. Replace <ISSUETYPE_ID> and <PROJECT_KEY> with your Jira issue type ID and project key, respectively:

          Note

          If you do not know your Jira issue type ID, see the following pages from the Jira Cloud documentation:

          {"fields":{"summary":"Moogsoft incident $id - $description","issuetype":{"id":"<ISSUETYPE_ID>"},"description":{
            "version": 1,
            "type": "doc",
            "content": [
              {
                "type": "paragraph",
                "content": [
                  {
                    "type": "text",
                    "text": "Moogsoft incident $id created with description $description \n\n Link to Moogsoft incident : "
                  },
                  {
                    "type": "text",
                    "text": "$incident_url",
                    "marks": [
                      {
                        "type": "link",
                              "attrs": {
                  "href": "$incident_url",
                  "title": "Moogsoft Incident"
                }
                      }
                    ]
                  }
                ]
              }
            ]
          },"project":{"key":"<PROJECT_KEY>"}}}

          The v3 payload uses the Atlassian Document Format (ADF) to render the incident URL. For more information about ADF, see the Jira documentation.

        • If you are using the v2 endpoint, copy and paste the following example payload. Replace <PROJECT_KEY> and <ISSUETYPE_ID> with your Jira project key and issue type ID, respectively:

          {
          	"fields": {
          		"project": {
          			"key": "<PROJECT_KEY>"
          		},
          		"summary": "Moogsoft Cloud Incident $id - $description",
          		"description": "Moogsoft Cloud Incident $id - $description",
          		"issuetype": {
          			"id": "<ISSUETYPE_ID>"
          		}
          	}
          }
    4. Map the Response Payload: External Name and ID:

      1. Under External Webhook Target, select "Jira" from the dropdown menu.

      2. Under Attribute Key with the External Name, copy and paste the following string:

        key\"\s*:\s*\"([^']+)\"
      3. Under Attribute Key with the External ID, copy and paste the following string:

        key\"\s*:\s*\"([^']+)\"
      4. Under External Link URL, copy and paste the following URL. Replace <yourDomain> with your Jira domain name:

        https://<yourDomain>.atlassian.net/jira/servicedesk/projects/MSD/queues/custom/6/$external_id
  3. Scroll up to the top of the page and click Test.

  4. Save the integration.