---
title: Update a static NRQL condition
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/alerts/newrelic-alerts-update-static-nrql-condition
---

The action identifier is `newrelic.alerts.updateStaticNrqlCondition`.

Updates an existing static NRQL alert condition. Every field except `accountId` and `id` is optional — only the fields you provide are changed; omitted fields keep their current value.

## Inputs

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 condition.                                                                                                                                                                                                                                                                 | `123456`                                                                                                                   |
| **id**                        | String  | **Required.** The ID of the condition to update.                                                                                                                                                                                                                                                                             | `"7654321"`                                                                                                                |
| **name**                      | String  | **Optional.** New name for the condition. Omit to leave unchanged.                                                                                                                                                                                                                                                           | `"High error rate v2"`                                                                                                     |
| **nrqlQuery**                 | String  | **Optional.** New NRQL query to evaluate. Omit to leave unchanged.                                                                                                                                                                                                                                                           | `"SELECT count(*) FROM TransactionError WHERE appName = 'MyApp'"`                                                          |
| **nrqlDataAccountId**         | Int     | **Optional.** Account to run the NRQL query against if different from `accountId`.                                                                                                                                                                                                                                           | `123456`                                                                                                                   |
| **enabled**                   | Boolean | **Optional.** Whether the condition is active. Set `false` to disable the condition.                                                                                                                                                                                                                                         | `false`                                                                                                                    |
| **terms**                     | List    | **Optional.** Replaces the condition's thresholds. Omit to leave unchanged. Each entry: `priority` (`CRITICAL` or `WARNING`), `operator` (`ABOVE`, `ABOVE_OR_EQUALS`, `BELOW`, `BELOW_OR_EQUALS`, `EQUALS`, or `NOT_EQUALS`), `threshold`, `thresholdDuration` (seconds), `thresholdOccurrences` (`ALL` or `AT_LEAST_ONCE`). | `[{"priority": "CRITICAL", "operator": "ABOVE", "threshold": 3, "thresholdDuration": 300, "thresholdOccurrences": "ALL"}]` |
| **description**               | String  | **Optional.** New description. Omit to leave unchanged.                                                                                                                                                                                                                                                                      | `"Updated description."`                                                                                                   |
| **runbookUrl**                | String  | **Optional.** New runbook URL. Omit to leave unchanged.                                                                                                                                                                                                                                                                      | `"https://runbooks.example.com/high-error-rate"`                                                                           |
| **titleTemplate**             | String  | **Optional.** New violation title template. Omit to leave unchanged.                                                                                                                                                                                                                                                         | `"{{ conditionName }} on {{ entity.name }}"`                                                                               |
| **violationTimeLimitSeconds** | Int     | **Optional.** Force-closes open violations after this many seconds.                                                                                                                                                                                                                                                          | `86400`                                                                                                                    |
| **signal**                    | Map     | **Optional.** Advanced signal and streaming settings. See `createStaticNrqlCondition` for field descriptions.                                                                                                                                                                                                                | `{"aggregationWindow": 60, "aggregationMethod": "EVENT_FLOW"}`                                                             |
| **expiration**                | Map     | **Optional.** Loss-of-signal settings. See `createStaticNrqlCondition` for field descriptions.                                                                                                                                                                                                                               | `{"closeViolationsOnExpiration": true, "expirationDuration": 300}`                                                         |
| **selectors**                 | List    | **Optional.** JQ selectors to extract values from the response.                                                                                                                                                                                                                                                              | ```yaml selectors:   - name: conditionId     expression: ".data.alertsNrqlConditionStaticUpdate.id" ```                    |

## Outputs

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 `id`, `name`, `enabled`, `policyId`, `entityGuid`, or `type` from `data`. ```json {   "data": {     "alertsNrqlConditionStaticUpdate": {       "id": "7654321",       "name": "High error rate v2",       "enabled": false,       "policyId": "2000002",       "entityGuid": "MTE5MzMzNDd8TlIxfE5SUV9DT05EQVRJT058NzY1NDMyMQ",       "type": "STATIC"     }   } } ``` |

## Example

The following example disables a static NRQL condition.

| Workflow example                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: update_static_nrql_condition description: Disable a static NRQL alert condition steps:   - name: updateCondition     type: action     action: newrelic.alerts.updateStaticNrqlCondition     version: 1     inputs:       accountId: ${{ .workflowInputs.accountId }}       id: ${{ .workflowInputs.conditionId }}       enabled: false     next: end ``` |
