---
title: "Use Case 10: Ticket from bot + categorizer"
description: "The customer submits a request from the bot; AI determines the type; action_tickets_create returns ticket_id in Runs."
level: advanced
use_case: 10
prerequisites:
  - ../basic/use-case-01-faq-ai.md
  - ../basic/use-case-02-menu-branching.md
  - ../concepts.md#categorizer-pattern
---

# Use Case 10: Ticket from bot + categorizer

> **Before you start:** read [Categorizer pattern](/en/learn/implementer/training/concepts.md#categorizer-pattern). Complete this in the **training bot** after the basic level (Use Case 1–9).

## Required permissions and access

| Module / setting | Why you need it |
|------------------|-----------------|
| **Scenario Builder** | Build the flow with categorizer and ticket create |
| **Fast Line Pro** | Categorizer agent (type “Chatbot”) |
| **Settings → Tickets** | Ticket subjects and `subject_alias` |
| **Settings → Bots** | Channel for testing (preview or Telegram) |
| **Runs / Chat preview** | Self-check: `ticket_id`, success/error edges |

If **Settings → Tickets** is missing from the menu — check your account permissions or contact whoever manages access in your organization / ConnectiveOne support.

## Business context

The customer describes a problem in free text in the bot. The system should automatically determine the request type, collect required fields, and create a ticket in ConnectiveOne. The ticket number must be available in Runs for further verification.

## Expected result

- Collection form: subject, description, priority
- Categorizer → category variable → `subject_alias` via **Router** / **`switch`**
- `action_tickets_create` → edges **`success`** and **`error`**
- The customer receives a confirmation with the ticket number
- **`ticket_id`** is saved in Runs/constants after success

## Architecture

```text
MessageKeyboard ("Submit a complaint") → WaitForInput (subject, description, priority)
   → action_fastline_pro (categorizer) → Router by category
   → action_tickets_create
      ├─ success → "Ticket created: {{ticket_id}}"
      └─ error → "Could not create" + retry or end
```

## Step-by-step implementation

### Step 0. Ticket subjects in Settings

> **Link to other settings:** `subject_alias` and ticket custom fields must match subjects in **Settings → Ticket settings**. Details: [configure tickets](/en/settings/how-to/configure-tickets.md).

Create (or reuse) subjects with aliases for training:

| Alias (example) | Purpose |
|-----------------|---------|
| `training_payment` | Payment issues |
| `training_delivery` | Delivery issues |
| `training_damage` | Damaged product |
| `training_order` | Incorrect order |

Write down the aliases — you need them in the Router in step 5.

---

### Step 1. Fast Line Pro — categorizer

1. **Fast Line Pro** → create an agent of type **Chatbot** (for example, “Training Ticket Categorizer”).
2. In the prompt, paste the text from [categorizer-training.txt](/content/en/learn/implementer/training/scenarios/prompts/categorizer-training.txt) — section **Use Case 10 (tickets)**.
3. Check in **Agent testing**: input “payment did not arrive” → output `payment`.

**What the categorizer does:** turns a free-form description into one category (`payment`, `delivery`, `damage`, `order`, `other`).

| Fast Line Pro parameter | Value |
|-------------------------|-------|
| Type | **Chatbot** (not Agent) |
| Prompt | [categorizer-training.txt](/content/en/learn/implementer/training/scenarios/prompts/categorizer-training.txt) |
| Output in scenario | variable `ticket_category` |

→ [Fast Line Pro action](/en/fastlinepro/how-to/use-action-fastline-pro.md)

---

### Step 2. MessageKeyboard — entry into the flow

| Parameter | Value |
|-----------|-------|
| Text | “Would you like to submit a request?” |
| Button | “Submit a complaint” · payload `ticket_start` |
| Keyboard type | inline |

**Edges:** button → first WaitForInput node (subject).

---

### Step 3. WaitForInput — collect fields

Use **three** nodes in sequence (or one with multiple fields if your instance supports it):

| Node | messageText | outputVariable |
|------|-------------|----------------|
| 1 | “Briefly describe the request subject” | `ticket_title` |
| 2 | “Detailed problem description” | `ticket_description` |
| 3 | “Priority: low / normal / high” | `ticket_priority` |

Validation: `none` for training (or limit priority to a list if needed).

**Edges:** last WaitForInput → Action categorizer.

---

### Step 4. Action — `action_fastline_pro` (categorizer)

| node_params | Value | Why |
|-------------|-------|-----|
| `agent_name` | `Training Ticket Categorizer` | Name from Fast Line Pro |
| `user_input` | `{{ticket_description}}` | Text to classify |
| `save_response` | `ticket_category` | Category for the Router |

**Edges (required):**

| Edge | Where |
|------|-------|
| Main output | Router (alias mapping) |
| **fallback** | MessageKeyboard: “Could not determine the type. Try rephrasing the description.” |

---

### Step 5. Router — map category to `subject_alias`

**Node:** Router (`action_router`), mode `first_match` + **default branch**.

| Rule | `subject_alias` |
|------|-----------------|
| `ticket_category` equals `payment` | `training_payment` |
| equals `delivery` | `training_delivery` |
| equals `damage` | `training_damage` |
| equals `order` | `training_order` |
| **Default** | `training_order` (or a separate “other” subject) |

After the Router — Set `subject_alias` (if needed) or go straight to `action_tickets_create`.

**Alternative:** Action **`switch`** with the same conditions.

---

### Step 6. Action — `action_tickets_create`

| node_params | Value | Why |
|-------------|-------|-----|
| `subject_alias` | `{{subject_alias}}` | Ticket subject from Settings |
| `ticket_description` | `{{ticket_description}}` | Description (v2 API, if available) |
| `additional_fields` | title, priority per subject docs | Subject custom fields |

> On newer instances you may have `action_tickets_create_v2` — check Node Inspector; the contract is similar.

**Edges (required):**

| Edge | Where | Why |
|------|-------|-----|
| **`success`** | MessageKeyboard: “Ticket created. Number: {{ticket_id}}” | The customer sees the result |
| **`error`** | MessageKeyboard: “Could not create the ticket. Check the data or try later.” | Without an error edge — silence |

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

---

## Troubleshooting in the scenario

| Symptom | What to check |
|---------|----------------|
| Edge **`error`** after create | `subject_alias` exists in Settings; subject custom fields; v1 vs v2 action |
| No `ticket_id` in Runs | Success edge is connected; action saves id in constants |
| Categorizer returns “extra” text | Prompt — only one category word; test Fast Line Pro separately |
| “Sticky” chat_room_id | Create parameters: do not reuse an old room without logic; compare a new Run vs the same dialog |

Details: [Edge-driven flow](/en/learn/implementer/training/concepts.md#edge-driven-flow) · [When it is not the scenario](/en/learn/implementer/training/reference/when-not-scenario.md)

## Self-check (Runs)

Before moving to [Use Case 11](/en/learn/implementer/training/advanced/use-case-11-broadcast.md), make sure:

- [ ] Three fields collected; trace shows `ticket_title`, `ticket_description`, `ticket_priority`
- [ ] Categorizer: description “card does not work” → `damage` (or your category)
- [ ] Router → correct `subject_alias` in constants
- [ ] Edge **`success`**: `ticket_id` present in Runs/constants
- [ ] Edge **`error`**: customer gets a message (simulate an invalid alias for the test, then restore the correct one)
- [ ] Categorizer fallback does not leave the customer without a reply

Record the result in [results-template.md](/en/learn/implementer/training/results-template.md).

## Independent task

Add a rule: if the categorizer returned `payment`, automatically set `ticket_priority` = `high` before create (via Set or a separate Router branch).

## Reference links

- [Categorizer pattern](/en/learn/implementer/training/concepts.md#categorizer-pattern)
- [Categorizer prompt](/content/en/learn/implementer/training/scenarios/prompts/categorizer-training.txt)
- [Configure tickets](/en/settings/how-to/configure-tickets.md)
- [Test a scenario](/en/scenariobuilder/how-to/test-scenario.md)
- [Built-in actions](/en/scenariobuilder/reference/standard-built-in-actions.md)

**Next step:** [Use Case 11: Broadcast](/en/learn/implementer/training/advanced/use-case-11-broadcast.md)
