---
title: Title template for NRQL alert conditions
source: https://docs.newrelic.com/docs/alerts/create-alert/condition-details/title-template
---

A title template is used when alert events are opened by the condition. It overrides the default title.

## Why use a title template? [#why-titles]

An alert condition is the foundation for alert event creation. Whether you're using our guided mode or crafting a condition from a chart or policy, using a unique title template is the final step to creating an alert condition.

Using the title template is optional but we recommend it. An alert condition defines a set of thresholds you want to monitor. If any of those thresholds are breached, an alert event is created. Meaningful title templates help you pinpoint issues and resolve outages faster.

/\* 


  Go to  \*\*\[one.newrelic.com > All capabilities](https&#x3A;//one.newrelic.com/all-capabilities)\*\* >  \*\*Alerts\*\*  >  \*\*Alert Conditions\*\* and select a pre-existing alert condition or create a new alert condition to use the title template to easily identify related alert events.
 \*/

## Before you begin [#begin]

Here are some key things to note before you use our title template:

-   **Compatibility**: The title template feature is available for NRQL conditions only.
-   **Character limit**: The maximum length for a title template is 256 characters.
-   **Formatting**: The title template must follow a valid [Handlebars](https://handlebarsjs.com/guide/) format.
-   **Lost signal alert events**: For alert events triggered by a lost signal, the default title will always be used. To learn more about signal loss, see [Loss of signal and gap filling](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-loss-signal-gap-filling/).

## Understand the title template [#example]

Let's say you run an e-commerce site and you have created an alert condition to trigger an alert event when networks errors are high. You can use a title template to make alert events from this condition easily identifiable.

You have named this alert condition `High Network Errors`. But you want the alert event title to reflect more information about the entity and priority.

**Example**:

```handlebars
{{conditionName}} Affecting {{entity.name}} - {{entity.type}} - {{priority}}
```

This template would generate the following alert event title:

```
High Network Errors Affecting Entity123 - Kubernetes Pod - Critical
```

## Use the title template [#use-titles]

You can interact with the title template in two ways: through the UI or using GraphQL.  Follow these steps to learn how.

**Create a title template in the UI**

1.  Navigate to the NRQL condition builder. For instructions, see [Alert conditions](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-conditions/alert-conditions/).
2.  Create your NRQL condition.
3.  In the final step, **Add details**, enter your title template in the **Title template** field.
4.  Save the condition.

**Create a title template in the GraphQL**

In GraphQL, the title template field is called `titleTemplate`. Here's an example mutation to update a NRQL static condition to add a title template:

````graphql
mutation {
  alertsNrqlConditionStaticUpdate(
    accountId: 123456
    id: 456789
    condition: {titleTemplate: "{{conditionName}} has triggered an incident"}
  ) {
    titleTemplate
  }
}
```

````

## Use attributes to further define your condition [#attributes]

You can include a subset of alert event attributes in your title templates to add more context.

Here's how:

-   **Use the format `{{AN_ATTRIBUTE}}`**. For example:

    ```handlebars
    {{conditionName}} has triggered an alert event
    ```
-   **Tag attributes**: For tags, use the format `{{tags.TAG_NAME}}`.
-   **Facet clause tags**: If a NRQL condition uses a `FACET` clause, you can use `tags` formatting to use those values in your title template. For example, if the NRQL query included `FACET hostName, cluster`, you could then use this:

    ```handlebars
    Host {{tags.hostName}}, cluster {{tags.cluster}} alert event
    ```

Tag names cannot contain spaces, but the expanded values can. For a full list of available attributes, see [Alert event attributes](https://docs.newrelic.com/docs/alerts/create-alert/condition-details/alert-event-attributes).
