---
title: "Action tickets_create_wrapped"
description: "Creates a ticket on behalf of a user by phone number (wrapper over tickets_create)."
---

# Action `tickets_create_wrapped`

> **System ID:** `action_tickets_create_wrapped`

## Description

Wrapper over `tickets_create`: temporarily switches the chat context to the phone number (`reg_phone`), creates a ticket on behalf of the found client, then restores the original context. Useful for cross-channel ticket creation (e.g. from a widget by phone).

During creation it follows the same path as `tickets_create` (including connect-to-operator), so **banned** and **limit** branches are possible. On success it may send a message from the bot constant `ticket_created_wrapped`.

## Events (scenario branches)

Same as `tickets_create` (the result is passed through from the inner call):

| Event | When it occurs |
|-------|----------------|
| **success** | Ticket created successfully |
| **banned** | User is under an active ban |
| **limit** | No free operator |
| **error** | Creation failure or exception in the inner call |
| **select_custom_field** | A custom field selection is required |
| **required_custom_field** | A required field is not filled |
| **optional_custom_field** | An optional field can be filled or skipped |

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `subject_alias` | string | yes | — | Ticket subject alias (placeholders) |

Other `tickets_create` parameters are also passed to the inner call.

**Required state constants:**

| Constant | Description |
|----------|-------------|
| `reg_phone` | Phone number used as `chat_id` for creation |
| `found_by_phone_client` | Client object found by phone |
| `found_by_phone_contact` | Contact object found by phone |

## Configuration example

```json
{
  "subject_alias": "support"
}
```

## Related docs

- [Actions reference](/en/actionjail/reference/actions-reference.md)
