Respond to New Relic alerts
This guide demonstrates how to respond to New Relic alerts by creating Jira issues or PagerDuty incidents through Port using workflows. Each workflow uses a webhook node that calls the target API directly, so no backend pipeline is required.
The PagerDuty response path filters the service picker to services connected to PagerDuty and routes the incident with New Relic alert context.
Common use cases
- Turn a New Relic alert into a Jira bug with the alert description, link, and reporting user attached.
- Open a PagerDuty incident from a New Relic alert and notify the on-call responder.
- Give responders a governed, one-click way to act on alerts without leaving Port.
- Keep alert response context connected to the affected service in your context lake.
Prerequisites
- Complete the onboarding process.
- Install Port's New Relic integration.
- Jira
- PagerDuty
To create Jira issues, you also need:
- Access to your Jira organization with permission to create issues.
- A Jira API token with permission to create issues.
- Port's Jira integration, or the ability to create the Jira issue blueprint manually.
To create PagerDuty incidents, you also need:
- Access to your PagerDuty organization with permission to manage incidents.
- Port's PagerDuty integration, or the ability to create the PagerDuty blueprints manually.
Set up data model
The New Relic, Jira, and PagerDuty integrations create their respective blueprints automatically. If you do not install one of these integrations, use the relevant steps below to create its blueprints manually.
Create the New Relic alert blueprint
-
Go to the Data model page in Port.
-
Click on + Blueprint.
-
Click on Edit JSON.
-
Copy and paste the following JSON configuration into the editor:
New Relic alert blueprint (click to expand)
{"identifier": "newRelicAlert","description": "This blueprint represents a New Relic alert in our context lake","title": "New Relic Alert","icon": "NewRelic","ownership": {"type": "Inherited","title": "Owning Teams","path": "alert_to_workload.service"},"schema": {"properties": {"priority": {"type": "string","title": "Priority","enum": ["CRITICAL","HIGH","MEDIUM","LOW"],"enumColors": {"CRITICAL": "red","HIGH": "red","MEDIUM": "yellow","LOW": "green"}},"state": {"type": "string","title": "State","enum": ["ACTIVATED","CLOSED","CREATED"],"enumColors": {"ACTIVATED": "yellow","CLOSED": "green","CREATED": "lightGray"}},"sources": {"type": "array","items": {"type": "string"},"title": "Sources"},"alertPolicyNames": {"type": "array","items": {"type": "string"},"title": "Alert Policy Names"},"conditionName": {"type": "array","items": {"type": "string"},"title": "Condition Name"},"link": {"type": "string","title": "Link","format": "url"},"description": {"type": "string","title": "Description"},"activatedAt": {"type": "string","title": "Activated at","format": "date-time"}},"required": []},"mirrorProperties": {"cloud_resource_name": {"title": "Cloud Resource","path": "cloud_resource.$title"},"port_service": {"title": "Service","path": "alert_to_workload.service.$title"},"team": {"title": "Team","path": "alert_to_workload.service.$team"},"workload_name": {"title": "Workload name","path": "alert_to_workload.$title"},"pager_duty_service": {"title": "PagerDuty service","path": "alert_to_workload.service.pager_duty_service.$identifier"}},"calculationProperties": {},"aggregationProperties": {},"relations": {"alert_to_workload": {"title": "Workload","target": "workload","required": false,"many": false},"cloud_resource": {"title": "Cloud resource","target": "newRelicCloudResource","required": false,"many": false}}} -
Click Save to create the blueprint.
- Jira
- PagerDuty
Create the Jira issue blueprint
-
Go to the Data model page in Port.
-
Click on + Blueprint.
-
Click on Edit JSON.
-
Copy and paste the following JSON configuration into the editor:
Jira issue blueprint (click to expand)
{"identifier": "jiraIssue","title": "Jira Issue","icon": "Jira","schema": {"properties": {"url": {"title": "Issue URL","type": "string","format": "url","description": "URL to the issue in Jira"},"status": {"title": "Status","type": "string","description": "The status of the issue"},"issueType": {"title": "Type","type": "string","description": "The type of the issue"},"components": {"title": "Components","type": "array","description": "The components related to this issue"},"assignee": {"title": "Assignee","type": "string","format": "user","description": "The user assigned to the issue"},"reporter": {"title": "Reporter","type": "string","description": "The user that reported the issue","format": "user"},"priority": {"title": "Priority","type": "string","description": "The priority of the issue"},"created": {"title": "Created at","type": "string","description": "The date and time when the issue was created","format": "date-time"},"updated": {"title": "Updated at","type": "string","description": "The date and time when the issue was updated","format": "date-time"}}},"calculationProperties": {},"relations": {}} -
Click Save to create the blueprint.
Create the PagerDuty service blueprint
-
Go to the Data model page in Port.
-
Click on + Blueprint.
-
Click on Edit JSON.
-
Copy and paste the following JSON configuration into the editor:
PagerDuty service blueprint (click to expand)
{"identifier": "pagerdutyService","description": "This blueprint represents a PagerDuty service in our context lake","title": "PagerDuty Service","icon": "pagerduty","schema": {"properties": {"description": {"type": "string","title": "Description"},"status": {"type": "string","title": "Status","enum": ["active","warning","critical","maintenance","disabled"]},"url": {"type": "string","format": "url","title": "Service URL"},"created_at": {"type": "string","format": "date-time","title": "Created at"},"updated_at": {"type": "string","format": "date-time","title": "Updated at"}},"required": []},"mirrorProperties": {},"calculationProperties": {},"relations": {}} -
Click Save to create the blueprint.
Create the PagerDuty incident blueprint
-
Go to the Data model page in Port.
-
Click on + Blueprint.
-
Click on Edit JSON.
-
Copy and paste the following JSON configuration into the editor:
PagerDuty incident blueprint (click to expand)
{"identifier": "pagerdutyIncident","description": "This blueprint represents a PagerDuty incident in our context lake","title": "PagerDuty Incident","icon": "pagerduty","schema": {"properties": {"status": {"type": "string","title": "Incident status","enum": ["triggered","annotated","acknowledged","reassigned","escalated","reopened","resolved"]},"url": {"type": "string","format": "url","title": "Incident URL"},"urgency": {"type": "string","title": "Incident urgency","enum": ["high","low"]},"responder": {"type": "string","title": "Assignee"},"escalation_policy": {"type": "string","title": "Escalation policy"},"created_at": {"title": "Created at","type": "string","format": "date-time"},"updated_at": {"title": "Updated at","type": "string","format": "date-time"}},"required": []},"mirrorProperties": {},"calculationProperties": {},"relations": {"pagerdutyService": {"title": "PagerDuty Service","target": "pagerdutyService","required": false,"many": true}}} -
Click Save to create the blueprint.
Create alert response
Choose whether to create a Jira issue or a PagerDuty incident. Each path uses a Port workflow with a webhook node that calls the target API directly.
- Jira
- PagerDuty
Create a Jira issue
Use this path to turn a New Relic alert into a Jira bug that includes the alert description, link, and reporting user. The workflow calls Jira's API directly from Port using a webhook node.
Add Port secret
If you have already installed Port's Jira integration, these secrets should already exist in Port. To view your existing secrets:
- Open the Credentials modal.
- Click on the
Secretstab.
Add a Base64-encoded Jira credential to Port:
-
Open the Credentials modal.
-
Click on the Secrets tab.
-
Click on + Secret and add
JIRA_AUTH. Generate its value by running:echo -n "your-email@domain.com:your-api-token" | base64Replace
your-email@domain.comwith the Jira user's email andyour-api-tokenwith that user's Jira API token. You only need to regenerate the value when the email or token changes.
Build the workflow
To create the workflow:
-
Go to the Workflows page in Port.
-
Click on the + Workflow button in the top-right corner.
-
In the Name field, enter
Report Bug from Newrelic, then click Confirm. -
On the editor page, click the see workflow JSON button (the code icon) to open the JSON editor.
-
Copy and paste the workflow JSON below to replace the example workflow:
Replace the variableReplace
<JIRA_ORGANIZATION_URL>with your Jira organization subdomain. For example, useexampleforhttps://example.atlassian.net.Report a bug from a New Relic alert workflow (click to expand)
{"identifier": "report_a_jira_bug_from_new_relic_alert","title": "Report a bug from New Relic alert","icon": "Jira","description": "Report a Jira bug in Port based on a New Relic alert.","allowAnyoneToViewRuns": true,"nodes": [{"identifier": "trigger","title": "Report Bug from New Relic alert","config": {"type": "SELF_SERVE_TRIGGER","userInputs": {"properties": {"alert": {"title": "New Relic alert","description": "The New Relic alert to report","icon": "NewRelic","type": "string","format": "entity","blueprint": "newRelicAlert"},"project": {"title": "Project","description": "The Jira project where the bug will be created","icon": "Jira","type": "string","format": "entity","blueprint": "jiraProject"}},"required": ["alert", "project"],"order": ["alert", "project"]},"contexts": [{"on": "ENTITY","userInput": "alert"}]}},{"identifier": "fetch_alert","title": "Fetch New Relic alert","config": {"type": "WEBHOOK","url": "https://api.port.io/v1/blueprints/newRelicAlert/entities/{{ .outputs.trigger.alert }}","method": "GET","synchronized": true},"variables": {"title": "{{ .result.response.data.entity.title }}","description": "{{ .result.response.data.entity.properties.description }}","link": "{{ .result.response.data.entity.properties.link }}"}},{"identifier": "create_jira_issue","title": "Create Jira issue","config": {"type": "WEBHOOK","url": "https://<JIRA_ORGANIZATION_URL>.atlassian.net/rest/api/3/issue","method": "POST","synchronized": true,"headers": {"Authorization": "Basic {{ .secrets.JIRA_AUTH }}","Content-Type": "application/json"},"body": {"fields": {"project": {"key": "{{ .outputs.trigger.project }}"},"summary": "Bug | New Relic | {{ .outputs.fetch_alert.title }}","description": {"version": 1,"type": "doc","content": [{"type": "paragraph","content": [{"type": "text","text": "\nNew Relic description: {{ .outputs.fetch_alert.description }}\n\nNew Relic link: {{ .outputs.fetch_alert.link }}"}]},{"type": "paragraph","content": [{"type": "text","text": "Reported by: {{ .workflowRun.trigger.by.email }}"}]}]},"issuetype": {"name": "Bug"}}}}}],"connections": [{"sourceIdentifier": "trigger","targetIdentifier": "fetch_alert"},{"sourceIdentifier": "fetch_alert","targetIdentifier": "create_jira_issue"}]} -
Click Save to create the workflow.
Test the flow
-
Go to the Self-service page in Port.
-
Run the Report a bug from New Relic alert workflow.
-
Select the New Relic alert and the Jira project where you want to create the bug.
-
Click Execute.
-
Confirm that the new bug appears in the selected Jira project.
Create a PagerDuty incident
Use this path to create a PagerDuty incident with the New Relic alert's description, link, service relationship, and requesting user. The workflow calls PagerDuty's API directly from Port using a webhook node and the API token from your PagerDuty integration.
Use PagerDuty integration secret
If you have already installed Port's PagerDuty integration, these secrets should already exist in Port. To view your existing secrets:
- Open the Credentials modal.
- Click on the
Secretstab.
The workflow below references the integration's built-in __PAGERDUTY_PAGERDUTY_TOKEN secret. You do not need to copy the PagerDuty token into another Port secret.
Build the workflow
To create the workflow:
-
Go to the Workflows page in Port.
-
Click on the + Workflow button in the top-right corner.
-
In the Name field, enter
Create Pagerduty Bug from Nre Relic, then click Confirm. -
On the editor page, click the see workflow JSON button (the code icon) to open the JSON editor.
-
Copy and paste the workflow JSON below to replace the example workflow:
Create a PagerDuty incident from a New Relic alert workflow (click to expand)
{"identifier": "create_pagerduty_incident_from_newrelic_alert","title": "Create PagerDuty incident from New Relic alert","icon": "pagerduty","description": "Create a PagerDuty incident from a New Relic alert and notify the on-call responder.","allowAnyoneToViewRuns": true,"nodes": [{"identifier": "trigger","title": "Alert and service","config": {"type": "SELF_SERVE_TRIGGER","userInputs": {"properties": {"alert": {"title": "New Relic alert","description": "The New Relic alert to respond to","icon": "NewRelic","type": "string","format": "entity","blueprint": "newRelicAlert"},"service": {"title": "Select a service","type": "string","format": "entity","blueprint": "service","dataset": {"combinator": "and","rules": [{"property": "pagerdutyServiceId","operator": "isNotEmpty"}]}}},"required": ["alert", "service"],"order": ["alert", "service"]},"contexts": [{"on": "ENTITY","userInput": "alert"}]}},{"identifier": "fetch_alert","title": "Fetch New Relic alert","config": {"type": "WEBHOOK","url": "https://api.port.io/v1/blueprints/newRelicAlert/entities/{{ .outputs.trigger.alert }}","method": "GET","synchronized": true},"variables": {"title": "{{ .result.response.data.entity.title }}","description": "{{ .result.response.data.entity.properties.description }}","link": "{{ .result.response.data.entity.properties.link }}"}},{"identifier": "fetch_service","title": "Fetch service","config": {"type": "WEBHOOK","url": "https://api.port.io/v1/blueprints/service/entities/{{ .outputs.trigger.service }}","method": "GET","synchronized": true},"variables": {"pagerdutyServiceId": "{{ .result.response.data.entity.properties.pagerdutyServiceId }}"}},{"identifier": "create_incident","title": "Create PagerDuty incident","config": {"type": "WEBHOOK","url": "https://api.pagerduty.com/incidents","method": "POST","synchronized": true,"headers": {"Authorization": "Bearer {{ .secrets.__PAGERDUTY_PAGERDUTY_TOKEN }}","Accept": "application/vnd.pagerduty+json;version=2","Content-Type": "application/json","From": "{{ .workflowRun.trigger.by.email }}"},"body": {"incident": {"type": "incident","title": "{{ .outputs.fetch_alert.title }}","service": {"id": "{{ .outputs.fetch_service.pagerdutyServiceId }}","type": "service_reference"},"urgency": "high","body": {"type": "incident_body","details": "{{ .outputs.fetch_alert.description }}\nNew Relic link: {{ .outputs.fetch_alert.link }}"}}}}}],"connections": [{"sourceIdentifier": "trigger","targetIdentifier": "fetch_alert"},{"sourceIdentifier": "fetch_alert","targetIdentifier": "fetch_service"},{"sourceIdentifier": "fetch_service","targetIdentifier": "create_incident"}]} -
Click Save to create the workflow.
The service input displays only services with a pagerdutyServiceId.
Test the flow
-
Go to the Self-service page in Port.
-
Run the Create PagerDuty incident from New Relic alert workflow.
-
Select the New Relic alert and the affected service.
-
Click Execute.
-
Confirm that the new incident appears under the selected PagerDuty service.