---
title: Templates
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Incident Response > Incident Management > Setup and Configuration >
  Templates
---

# Templates

## Overview{% #overview %}

Dynamic templates offer a comprehensive framework for improving incident response and operational efficiency. Using custom message templates for both ad-hoc and automated notifications can save time during high-stress incidents. This ensures that messages are consistently accurate and contain relevant context, enabling quicker understanding and action by the recipients.

Customizable settings for postmortem analysis can provide valuable information and long-term optimization. By tailoring reports and dashboards to your organization's unique context, you can identify recurring issues and implement preventative measures more effectively.

## Messages{% #messages %}

Message templates are dynamic, reusable messages that can be used in [manual incident notifications](https://docs.datadoghq.com/incident_response/incident_management/notifications.md), or automated notification rules. Message templates use [template variables](https://docs.datadoghq.com/incident_response/incident_management/setup_and_configuration/variables.md), such as `{{incident.severity}}`, to dynamically inject the corresponding value from the incident that the notification is being sent for. Message templates have Markdown support so that incident notifications can include text formatting, tables, indented lists, and hyperlinks. To better organize a large number of message templates, each template requires a category during the creation process.

To create a message template:

1. Click the **+ New Message Template** button.
1. Give the template a name.
1. Assign it a new or existing category.
1. Give the template a subject line (for emails).
1. Write the template's message.
1. Click **Save**.

**Note:** Template variables are supported in both the message's title and body.

### AI variables for notifications{% #ai-variables-for-notifications %}

Incident AI can dynamically populate key details in notifications with AI-generated content. Insert any of the following variables into your message body:

| Field                   | Variable                               |
| ----------------------- | -------------------------------------- |
| AI Contributing Factors | `{{incident.ai_contributing_factors}}` |
| AI Impact               | `{{incident.ai_impact}}`               |
| AI Issue                | `{{incident.ai_issue}}`                |
| AI Remediation          | `{{incident.ai_remediation}}`          |

{% image
   source="https://docs.dd-static.net/images/service_management/incidents/incident_ai/message_template_variables.7f3d6f2a065a087fd74e9870791fb25b.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/service_management/incidents/incident_ai/message_template_variables.7f3d6f2a065a087fd74e9870791fb25b.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="New message template with AI variables in it" /%}

## Postmortems{% #postmortems %}

Postmortem templates define the structure and content of your postmortems. When you generate a postmortem, Datadog automatically populates the template with data from the incident. Use [template variables](https://docs.datadoghq.com/incident_response/incident_management/setup_and_configuration/variables.md), such as `{{incident.severity}}`, to control which incident data is included.

To create a postmortem template:

1. Go to [**Incident Management Settings > Postmortem Templates**](https://app.datadoghq.com/incidents/settings?section=postmortem-templates) and click **+ New Postmortem Template**.
1. Give the template a name.
1. Select the save location (see Save location).
1. Write the template's content (available template variables are listed to the right of the textbox).
1. (Optional) Set the template as the default.
1. Click **Save**.

### Save location{% #save-location %}

Select where the generated postmortem document is saved:

| Option                | Requirements                                                                                                                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Datadog Notebooks** | No additional setup required.                                                                                                                                                                     |
| **Confluence**        | Requires the [Confluence integration](https://docs.datadoghq.com/integrations/confluence.md). Configure your Confluence account in the integration settings before selecting it as a destination. |
| **Google Drive**      | Requires the [Google Drive integration](https://docs.datadoghq.com/integrations/google_drive.md). Configure your Google account in the integration settings before selecting it as a destination. |

### Template variables for postmortems{% #template-variables-for-postmortems %}

Templates support variables that populate with incident data when the postmortem is generated. For a full list of available variables, see the [Incident Variables](https://docs.datadoghq.com/incident_response/incident_management/setup_and_configuration/variables.md) reference.

{% collapsible-section %}
#### Standard variables

Standard variables pull directly from incident fields and also include any defined [custom property fields](https://docs.datadoghq.com/incident_response/incident_management/setup_and_configuration/property_fields.md).

| Variable                 | Description                                                               |
| ------------------------ | ------------------------------------------------------------------------- |
| `{{incident.title}}`     | The incident title                                                        |
| `{{incident.state}}`     | The current incident state (for example: `active`, `stable`, `resolved`)  |
| `{{incident.severity}}`  | The incident severity level                                               |
| `{{incident.commander}}` | The incident commander's name, or their email or handle if no name is set |

{% /collapsible-section %}

{% collapsible-section %}
#### Incident card variable

The incident card variable (`{{incident.card}}`) embeds a summary card that reflects incident fields in real time. When incident fields change, the card in the postmortem updates automatically. The card includes postmortem status and owner fields.

**Note**: The incident card is only supported in Datadog Notebooks.
{% /collapsible-section %}

{% collapsible-section %}
#### Follow-ups variable

The follow-ups variable (`{{incident.follow-ups}}`) embeds a list of incident follow-ups in the postmortem notebook. From the list view in your notebook, you can set due dates, assign items, or create new follow-up items. Changes are reflected in the incident's follow-ups list.

**Note**: The follow-ups variable is only supported in Datadog Notebooks.
{% /collapsible-section %}

{% collapsible-section %}
#### AI variables

AI variables use Bits AI to generate suggested content based on incident data. When you generate a postmortem that includes an AI variable, Datadog provides a suggested value that you can accept, edit, or reject before it is saved.

| Variable                          | Description                         |
| --------------------------------- | ----------------------------------- |
| `{{incident.ai_summary}}`         | Executive summary                   |
| `{{incident.ai_system_overview}}` | System context and dependencies     |
| `{{incident.ai_key_timeline}}`    | Key event timeline                  |
| `{{incident.ai_customer_impact}}` | Summary of customer impact          |
| `{{incident.ai_action_items}}`    | Follow-up actions                   |
| `{{incident.ai_lessons_learned}}` | Key takeaways for future prevention |

To use these variables:

1. Add the variables to the template body.
1. When generating a postmortem, select the **General incident with AI content** out-of-the-box template, or a custom template that includes AI variables.
1. Allow up to one minute for AI-generated content to populate. Datadog recommends reviewing and refining AI-generated content before sharing the postmortem.

**Note**:

- AI variables must be preceded by a section header.

- The incident timeline must contain at least 10 messages for AI variables to generate content.

{% /collapsible-section %}

For more information on generating postmortems using these templates, see [Incident Postmortems](https://docs.datadoghq.com/incident_response/incident_management/post_incident/postmortems.md).

## Further reading{% #further-reading %}

- [Incident variables reference](https://docs.datadoghq.com/incident_response/incident_management/setup_and_configuration/variables.md)
- [Learn more about Incident Management Notifications](https://docs.datadoghq.com/incident_response/incident_management/notification.md)
- [Incident Postmortems](https://docs.datadoghq.com/incident_response/incident_management/post_incident/postmortems.md)
