• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Get an alert policy

|View as Markdown (English)

The action identifier is newrelic.alerts.getPolicy.

Retrieves the details of a single alert policy.

The following table describes all available input fields for this action.

Input

Type

Description

Example

accountId

Int

Required. The New Relic account that owns the policy.

123456

id

String

Required. The ID of the policy to retrieve.

"2000002"

selectors

List

Optional. JQ selectors to extract values from the response.

selectors:
- name: policyName
expression: ".data.actor.account.alerts.policy.name"

The following table describes all output fields returned by this action.

Output

Type

Description

success

Boolean

true when the step executed without error.

errorMessage

String

Error message on failure. null on success.

data

Map

NerdGraph response. Use selectors to extract fields from .data.actor.account.alerts.policy.

{
"data": {
"actor": {
"account": {
"alerts": {
"policy": {
"id": "2000002",
"name": "Production Services",
"incidentPreference": "PER_CONDITION",
"accountId": 123456,
"entityGuid": "MjAwMDAwMnxBTEVSVFN8UE9MSUNZfDIwMDAwMDI"
}
}
}
}
}
}

The following example fetches a policy's current name before deciding whether to update it.

Workflow example

name: get_alert_policy
description: Get an alert policy
steps:
- name: getPolicy
type: action
action: newrelic.alerts.getPolicy
version: 1
inputs:
accountId: ${{ .workflowInputs.accountId }}
id: ${{ .workflowInputs.policyId }}
selectors:
- name: policyName
expression: ".data.actor.account.alerts.policy.name"
next: end
Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.