> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/actions/context/entity-incident.md).

# entity (incident)

Reference for the entity (incident) variable in action placeholders and conditions.

{% hint style="info" %}
This page describes the `entity` variable on incident actions, one of the variables you can use in `{{ }}` placeholders and conditions when you customize an action's YAML definition. It is available in `steps` and in templated settings (such as a webhook body), not in `inbound`. Start with [Actions → Custom behavior](https://docs.ilert.com/integrations/actions.md#custom-behavior-advanced-topic) for how the definition works.
{% endhint %}

`entity` on incident actions. Fields without a value are left out. The fields under "Event-specific" are present only on automatic runs of the named event; manual and delayed runs do not carry them.

Uses: [Context schema: entity](https://docs.ilert.com/integrations/actions/context/entity.md).

```yaml
openapi: 3.1.0
info:
  title: ilert action context - incident entity
  version: 1.0.0
  description: >-
    `entity` on incident actions. Fields without a value are left out. The
    fields under "Event-specific" are present only on automatic runs of the
    named event; manual and delayed runs do not carry them.
components:
  schemas:
    IncidentEntity:
      type: object
      required: [kind, id]
      additionalProperties: true
      properties:
        kind:
          const: INCIDENT
        id:
          type: integer
        number:
          type: integer
          description: Incident number shown in ilert.
        title:
          type: string
        summary:
          type: string
        status:
          type: string
          enum: [DECLARED, INVESTIGATING, IDENTIFIED, MONITORING, RESOLVED]
        severity:
          type: integer
        declaredAt:
          type: string
          format: date-time
        resolvedAt:
          type: string
          format: date-time
        declaredBy:
          $ref: './entity.md#/components/schemas/IdName'
        resolvedBy:
          $ref: './entity.md#/components/schemas/IdName'
        alertCount:
          type: integer
        responderCountTotal:
          type: integer
        responderCountJoined:
          type: integer
        teamIds:
          type: array
          items:
            type: integer
        serviceIds:
          type: array
          description: Ids of the affected services.
          items:
            type: integer
        affectedServices:
          type: array
          items:
            type: object
            properties:
              service:
                $ref: '#/components/schemas/Service'
              impact:
                type: string
                enum: [OPERATIONAL, UNDER_MAINTENANCE, DEGRADED, PARTIAL_OUTAGE, MAJOR_OUTAGE]
                description: How the incident affects this service. Same values as the service status.
        responders:
          type: array
          items:
            $ref: '#/components/schemas/Responder'
        channel:
          $ref: './entity.md#/components/schemas/IdName'
          description: The incident channel.
        url:
          type: string
          format: uri
          description: Link to the incident in ilert.
          examples: ["https://acme.ilert.com/op-incident/view?id=42"]

        # Event-specific
        comment:
          type: object
          description: "`incident.comment_added` only."
          properties:
            content:
              type: string
        severityChanged:
          type: boolean
          description: "`incident.updated` only."
        respondersDelta:
          type: array
          description: "`incident.responder_added`, `incident.responder_removed`, `incident.responder_updated` only. The responders that changed."
          items:
            $ref: '#/components/schemas/Responder'
        postmortem:
          type: object
          description: "`incident.postmortem_linked` only."
          properties:
            id:
              type: integer
            status:
              type: string
              enum: [NONE, REQUESTED, STARTED, CREATED, LINKED, ERROR]
            visibility:
              type: string
              enum: [NONE, PRIVATE, PUBLIC]
            linkUrl:
              type: string
            markdownUrl:
              type: string
        statusUpdatePublishCount:
          type: integer
          description: "`incident.resolved` only. Number of status updates published."

    Responder:
      type: object
      properties:
        user:
          $ref: './entity.md#/components/schemas/User'
        status:
          type: string
          enum: [ADDED, NOTIFIED, JOINED, DECLINED]
        role:
          type: string
          examples: [INCIDENT_COMMANDER, COMMUNICATIONS_LEAD, RESPONDER]
        notifiedAt:
          type: string
          format: date-time
        acceptedAt:
          type: string
          format: date-time
        declinedAt:
          type: string
          format: date-time

    Service:
      type: object
      additionalProperties: true
      properties:
        id:
          type: integer
        name:
          type: string
        alias:
          type: string
        status:
          type: string
          enum: [OPERATIONAL, UNDER_MAINTENANCE, DEGRADED, PARTIAL_OUTAGE, MAJOR_OUTAGE]
        description:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ilert.com/integrations/actions/context/entity-incident.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
