---
name: ticket-import
description: Convert exported support tickets or Discord ticket transcripts (any bot, any format) into Tikkora's import JSON, so its AI assistant can learn from them.
---

# Convert support tickets into Tikkora's import format

You are helping a server admin import their **old support tickets** into Tikkora. Tikkora reads them, keeps the ones where staff solved something, and learns how their team answers. Your job: turn whatever the user gives you (HTML/TXT/JSON transcripts from another ticket bot, a Discord export, a spreadsheet, a database dump…) into **JSON files in the format below**, and nothing else.

## Output format

Each file is a **JSON array** of tickets:

```json
[
  {
    "externalId": "oldbot:1042",
    "subject": "Lost my items after a crash",
    "categoryKey": null,
    "messages": [
      { "authorName": "steve", "role": "user", "content": "I died to a server lag spike and lost everything.", "at": "2026-01-26T16:53:05Z" },
      { "authorName": "nicel", "role": "staff", "content": "Restored your inventory from the backup, check now.", "at": "2026-01-26T17:10:12Z" }
    ]
  }
]
```

| Field | Rules |
|---|---|
| `externalId` | Stable and unique per ticket, 1–200 characters. Prefix with the source, e.g. `oldbot:1042`. Importing the same id twice is skipped, so keep ids stable between runs. |
| `subject` | 1–200 characters. The ticket's title; if there is none, use a short summary of the player's first message. |
| `categoryKey` | `null`, unless the user gave you their Tikkora category keys and the ticket clearly fits one (lowercase key such as `report`). When unsure, use `null`; Tikkora classifies it. |
| `messages` | 1–500 messages, oldest first. |
| `messages[].authorName` | 1–100 characters. The display name or username. |
| `messages[].role` | `"user"` for the player who opened the ticket (and other non-staff), `"staff"` for the support team. |
| `messages[].content` | The text, at most 4000 characters (cut longer ones). May be empty only if the message had attachments. |
| `messages[].at` | Optional ISO 8601 timestamp. |

## How to convert

1. **Find the tickets.** One ticket = one conversation (usually one file, thread or channel).
2. **Decide who is staff.** Use explicit markers if the source has them (role names, "staff"/"support" badges, the bot that closed tickets). Otherwise: people who appear in many different tickets that are not their own are staff; the person who opened the ticket is the user. Ask the user for a list of staff names if you cannot tell.
3. **Drop noise.** Leave out bot messages (welcome embeds, "ticket claimed", "ticket closed", buttons), empty messages and system lines. Keep the opening form answers: turn them into the player's first message as `Question: answer` lines.
4. **Clean the text.** Replace mentions like `<@123456>` with `@name` when you know the name. Turn attachments into `[attachment: filename]` at the end of the message. Remove email addresses, payment details and passwords (replace with `[removed]`).
5. **Skip tickets that are useless for learning:** no messages, or no human conversation at all. Keep tickets without a staff reply only if the user asks you to; Tikkora skips them anyway.
6. **Write the files.** Valid JSON only (no comments, no trailing commas). Keep each file **under 2 MB**; split into `tickets-01.json`, `tickets-02.json`, … when needed. At most 10 files are uploaded at once.

## Before you finish

- Every ticket has `externalId`, `subject` and at least one message.
- Every message has `authorName`, `role` (`user` or `staff`) and `content`.
- The JSON parses, and no file is over 2 MB.
- Tell the user how many tickets you converted, how many you skipped and why, and who you treated as staff.

Then the user uploads the files on the dashboard's **Import** page (or in Discord: `/config` → AI → Import transcripts).
