Integrate with New Relic

Overview

What does the integration offer?

Jira Service Management has native integration with New Relic workflows. Use the integration to send New Relic issues to Jira Service Management’s API with detailed information. Jira Service Management acts as a dispatcher for New Relic issues, determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates alerts until the alert is acknowledged or closed.

This document describes how to configure the integration and details of data that Jira Service Management receives from New Relic.

How does the integration work?

  • When an alert is created in New Relic Workflows, an alert is also created in Jira Service Management automatically through the integration.

  • When an alert is closed in New Relic Workflows, the related alert automatically closes in Jira Service Management through the integration.

  • When an alert is acknowledged in New Relic Workflows, the related alert is also acknowledged in Jira Service Management automatically through the integration.

Set up the integration

  • New Relic is an API-based integration. Setting it up involves the following steps:

  • Add a New Relic integration in Jira Service Management

  • Configure the integration in New Relic

Add New Relic integration

If you're using the Free or Standard plan in Jira Service Management, you can only add this integration from your team’s operations page. To access the feature through Settings (gear icon) > Products (under JIRA SETTINGS) > OPERATIONS, you need to be on Premium or Enterprise plan.

Adding an integration from your team’s operations page makes your team the owner of the integration. This means Jira Service Management only assigns the alerts received through this integration to your team.

To add a New Relic integration in Jira Service Management:

  1. Go to your team’s operations page.

  2. On the left navigation panel, select Integrations and then Add integration.

  3. Run a search and select “New Relic”.

  4. On the next screen, enter a name for the integration.

  5. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.

  6. Select Continue.
    The integration is saved at this point.

  7. Expand the Steps to configure the integration section and copy the endpoint URL.
    You will use this URL while configuring the integration in New Relic later.

  8. Select Turn on integration.
    The rules you create for the integration will work only if you turn on the integration.

Configure the integration in New Relic

  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 following section.

  8. Select Update message.

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

New Relic Payload template

{ "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

{ "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 } }
[ "owner" : "John Doe", "severity" : "CRITICAL", "policy_url" : "http://localhost/policy/1", "teams" : [ "team1", "team2" ], "target_name" : "Test Target", "target_type" : "Server", "policy_name" : "test policy", "incident_url" : "http://localhost/incident/1", "incident_acknowledge_url" : "http://localhost/incident/1/acknowledge", "tags" : [ "tag1", "tag2" ], "event_type" : "INCIDENT", "incident_id" : "1", "target_link" : "http://localhost/target/12345", "runbook_url" : "http://localhost/runbook/url", "recipients" : [ "user1", "user2" ], "target_labels" : [ "production", "hostname" ], "details" : "CPU > 50% for 5 minutes", "state" : "open", "condition_name" : "test condition", "target_product" : "productName", "timestamp" : "123456789000" ]

See also

https://operations-help.atlassian.net/wiki/spaces/OPSHELP/pages/2129963

https://operations-help.atlassian.net/wiki/spaces/OPSHELP/pages/4653078

https://operations-help.atlassian.net/wiki/pages/createpage.action?spaceKey=OPSHELP&title=Add%20integration%20rules&linkCreation=true&fromPageId=4292707