Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Select Alert & AI from the side menu from your New Relic account.

  2. Select Destinations.

  3. Create a Webhook destination.

  4. Enter a name for the Webhook.

  5. Paste the URL you copied while adding the integration in Jira Service Management into Endpoint URL.

  6. Select Workflows from Alerts & AI and create a new workflow.
    Use the webhook destination you created earlier.

  7. Test the New Relic payload in the Payload template for webhook.
    For the New Relic payload template, see the support article.

  8. Select Update message.

  9. Select Activate workflow.
    Verify if the workflow is enabled in New Relic.

New Relic Payload template

Expand
titlePayload template to use while creating a new Workflow in New Relic
Code Block
{
  "tags": "tag1,tag2",
  "teams": "team1,team2",
  "recipients": "user1,user2",
  "payload": {
  "condition_id": {{json accumulations.conditionFamilyId.[0]}},
  "condition_name": {{json accumulations.conditionName.[0] }},
  "current_state": {{#if issueClosedAtUtc}} "closed" {{else if issueAcknowledgedAt}} "acknowledged" {{else}} "open"{{/if}},
  "details": {{json issueTitle}},
  "event_type": "Incident",
  "incident_acknowledge_url": {{json issueAckUrl }},
  "incident_api_url": "N/A",
  "incident_id": {{json issueId }},
  "incident_url": {{json issuePageUrl }},
  "owner": "N/A",
  "policy_name": {{ json accumulations.policyName.[0] }},
  "policy_url":  {{json issuePageUrl }},
  "runbook_url": {{ json accumulations.runbookUrl.[0] }},
  "severity": {{#eq "HIGH" priority}} "WARNING" {{else}}{{json priority}} {{/eq}},
  "targets": {
    "id": {{ json entitiesData.entities.[0].id }},
    "name": {{ json entitiesData.entities.[0].name }},
    "type": "{{entitiesData.entities.[0].type }}",
      "product": "{{accumulations.conditionProduct.[0]}}"
    },
    "timestamp": {{#if closedAt}} {{ closedAt }} {{else if acknowledgedAt}} {{ acknowledgedAt }} {{else}} {{ createdAt }} {{/if}}
  }
}

Sample JSON payload sent from New Relic

Expand
titleSample payload (in JSON format)
Code Block
{
      "tags": "tag1,tag2",
      "teams": "team1,team2",
      "recipients": "user1,user2",
      "payload": {
        "condition_id": 1,
        "condition_name": "test condition",
        "current_state": "open",
        "details": "CPU > 50% for 5 minutes",
        "event_type": "INCIDENT",
        "incident_acknowledge_url": "http://localhost/incident/1/acknowledge",
        "incident_api_url": "http://localhost/api/incident/1",
        "incident_id": 1,
        "incident_url": "http://localhost/incident/1",
        "owner": "John Doe",
        "policy_name": "test policy",
        "policy_url": "http://localhost/policy/1",
        "runbook_url": "http://localhost/runbook/url",
        "severity": "CRITICAL",
        "targets": [
          {
            "id": "12345",
            "link": "http://localhost/target/12345",
            "name": "Test Target",
            "labels": [
              "production",
              "hostname"
            ],
            "type": "Server",
            "product" : "productName"
          }
        ],
        "timestamp": 123456789000
      }
}

...