> For the complete documentation index, see [llms.txt](https://docs.ebbot.ai/ebbot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ebbot.ai/ebbot-docs/integrations/automations-integrations/integration-setup-guides/easit-integration-in-automations/actions/find-item-by-ticket-number.md).

# Find Easit Item by Ticket Number

Find an Easit item by the ticket number shown in Easit's UI (sequenceId) and return the item, including the internal id that the update, field and email actions require.

**Action identifier:** `find_item_by_ticket_number`.

### Inputs

| Field           | Type    | Required/default | Meaning                                                           |
| --------------- | ------- | ---------------- | ----------------------------------------------------------------- |
| `ticket_number` | integer | Required         | The ticket number as displayed in Easit, not the internal item id |

Example input:

```json
{
  "ticket_number": 9453
}
```

### Output

Paths are relative to this action's output. Select them from the builder's variable picker rather than typing them. A field that is null or empty was not returned by Easit; it is not proof that the value is empty in Easit.

| Path                              | Type             | Meaning                                                                                                                              |
| --------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `item`                            | object           | The matched Easit item, including fields and identifiers.                                                                            |
| `item.id`                         | integer          | Internal numeric Easit Item.id; use this for GraphQL actions.                                                                        |
| `item.sequence_id`                | integer \| null  | Visible ticket number (Item.sequenceId), when available; not the GraphQL item id.                                                    |
| `item.module_id`                  | integer \| null  | Tenant-specific numeric module id, when available.                                                                                   |
| `item.item_type`                  | integer \| null  | Easit item type id, when available.                                                                                                  |
| `item.parent_item_id`             | integer \| null  | Internal id of the parent item, when available.                                                                                      |
| `item.external_id`                | string \| null   | External identifier stored on the item.                                                                                              |
| `item.uuid`                       | string \| null   | Item UUID returned by Easit.                                                                                                         |
| `item.tags`                       | array of strings | Tags attached to the item or message.                                                                                                |
| `item.fields`                     | object           | Raw item fields keyed by their system names.                                                                                         |
| `item.subject`                    | string \| null   | The ticket's subject (sys\_subject)                                                                                                  |
| `item.description`                | string \| null   | The ticket's description text (sys\_description)                                                                                     |
| `item.field_values`               | array of objects | Every non-empty field as a system\_name/value row, so individual values are selectable and readable without knowing the keys upfront |
| `item.field_values[].system_name` | string           | Exact Easit field system name.                                                                                                       |
| `item.field_values[].value`       | string           | Non-empty item field value rendered as readable text.                                                                                |
| `item.text`                       | string           | The item's non-empty fields rendered as 'system\_name: value' lines, ready to drop into a prompt                                     |

### Declared errors

Instead of the output above, the action can return one of these objects. Check for them before using the output in a later step.

#### `TicketNotFound`

| Path            | Type            | Meaning                                                |
| --------------- | --------------- | ------------------------------------------------------ |
| `exists`        | boolean         | False when no matching item or field was found.        |
| `ticket_number` | integer         | Visible Easit ticket number requested by the workflow. |
| `module_id`     | integer \| null | Tenant-specific numeric module id, when available.     |

#### `EasitUnavailable`

Easit could not be reached, or refused the request.

| Path        | Type           | Meaning                                                        |
| ----------- | -------------- | -------------------------------------------------------------- |
| `reachable` | boolean        | False when Easit could not be reached or rejected the request. |
| `endpoint`  | string \| null | Easit API endpoint involved in the failed request, when known. |
| `error`     | string         | Safe error code or diagnostic without credentials.             |
| `hint`      | string \| null | Suggested connection or permission check, when available.      |

### Behavior and limits

Converts the ticket number shown in Easit's UI into the internal GraphQL item id. Pass `ticket_number` as an integer, for example `{"ticket_number": 9453}`.

Searches the connection's configured module, then returns the same complete `item` as [**Get Easit Item (GraphQL)**](https://docs.ebbot.ai/ebbot-docs/integrations/automations-integrations/integration-setup-guides/easit-integration-in-automations/actions/get-item-graphql.md). Use `item.id` for subsequent GraphQL actions; `item.sequence_id` is the visible number.

Returns declared `TicketNotFound` or `EasitUnavailable` errors. The latter covers both module/ticket lookup failures and failure while reading the matched item.

See [Troubleshooting](https://docs.ebbot.ai/ebbot-docs/integrations/automations-integrations/integration-setup-guides/easit-integration-in-automations/troubleshooting.md), or return to the [action catalog](https://docs.ebbot.ai/ebbot-docs/integrations/automations-integrations/integration-setup-guides/easit-integration-in-automations/actions.md).
