# Tickets

URL: https://zerodev.ca/docs/medusa/modules/ticket

> Private support tickets from panels, with claiming, support tiers, priorities, inactivity closing and transcripts.



Members open a private ticket channel from a panel. Staff claim it, move it between support tiers if needed and close it, and the conversation is saved as a transcript.

## How It Works

1. A member picks a category on a panel and answers its questions. A private channel opens.
2. Staff are pinged and one of them claims the ticket.
3. If needed, staff raise the ticket to a higher support tier, which gives that tier's role access.
4. Staff close the ticket. A transcript is saved, posted and sent to the member, and the channel is deleted.

Members can always ask for their ticket to be closed with `/ticket close request`. Turn on **Allow Creators to Close** to let them close it themselves.

## Panels and Categories

A panel holds one or more categories and shows them as buttons or a select menu. Post a panel from the dashboard **Post** page or with `/post`.

Each category has its own ID, button label, emoji and description, and sets:

| Field                 | What it does                                        |
| --------------------- | --------------------------------------------------- |
| Channel Category      | Discord category new tickets are created in.        |
| Ping Roles on Open    | Roles pinged when a ticket opens.                   |
| Modal Builder         | Up to five questions asked before the ticket opens. |
| Welcome Message       | First message in the ticket.                        |
| Allowed Roles to Open | Only these roles can open this category.            |
| Grant Roles on Open   | Roles given to the opener while the ticket is open. |
| Support Roles         | Roles that can see and reply in the ticket.         |
| Starting Support Tier | Tier a new ticket starts at.                        |

## Who Counts as Staff

Each category adds a &#x2A;*Tickets ( Category )** permission on the **Permissions** page. Members whose rank has it, members with Administrator and members with a support tier role can claim, close and manage those tickets.

## Support Tiers

**Support Tiers** is an ordered list of roles. `/ticket action raise` moves a ticket up to a tier and gives that role access, and `lower` moves it back down. **Show Escalation Buttons** adds raise and lower buttons inside tickets.

## Priorities

With **Enable Priorities** on, list your levels from highest to lowest and give each the roles that start there. A new ticket starts at the highest level the opener has a role for, otherwise the lowest. The priority shows in the welcome message, channel topic, logs and dashboard. With **Sort Tickets By Priority** on, open tickets are ordered by priority in their category.

## Inactivity

With **Inactivity Auto-Close** on, a ticket with no messages for **Inactivity Hours** gets a warning. If nobody replies within **Inactivity Grace Hours**, it closes. `/ticket inactivity whitelist` exempts a ticket.

## Transcripts

Closed tickets are saved as transcripts, posted in the **Transcript Channel**, sent to the member and shown on the **Tickets** dashboard page. **Transcript Format** picks between an HTML page styled like Discord (avatars, role colours, embeds, attachments, reactions and formatting) or a plain `.txt` log. **Transcript Hosting** stores them in the database (API) or on disk (File). API transcripts larger than 60,000 characters are written to disk instead of being cut short.

Attachment and avatar images in HTML transcripts load from Discord's CDN, so files deleted from Discord stop showing.

## Settings

**Ticket Settings**

| Setting                   | Default              | What it does                                         |
| ------------------------- | -------------------- | ---------------------------------------------------- |
| Default Ticket Category   | None                 | Discord category used when a category sets none.     |
| Default Panel Style       | Buttons              | Buttons or select menu.                              |
| Channel Naming            | `ticket-%number%`    | Name of new ticket channels.                         |
| Max Open Per User         | 3                    | Open tickets one member can have.                    |
| Allow Creators to Close   | Off                  | Lets members close their own tickets.                |
| Allowed Roles to Open     | None                 | Roles allowed to open any ticket.                    |
| Grant Roles on Open       | None                 | Roles given to every opener.                         |
| Ping Staff On Open        | On                   | Pings staff on new tickets.                          |
| Direct Message Opener     | On                   | DMs the member updates and the transcript.           |
| Show Claim Button         | On                   | Adds a claim button.                                 |
| Show Close Request Button | On                   | Adds a close request button.                         |
| Show Escalation Buttons   | On                   | Adds tier buttons.                                   |
| Enable Transcripts        | On                   | Saves transcripts.                                   |
| Transcript Channel        | None                 | Where transcripts are posted.                        |
| Transcript Format         | HTML (Discord Style) | HTML page styled like Discord, or a plain text file. |
| Transcript Hosting        | API (Database)       | Where transcripts are stored.                        |
| Inactivity Auto-Close     | Off                  | Closes quiet tickets.                                |
| Inactivity Hours          | 48                   | Quiet time before a warning.                         |
| Inactivity Grace Hours    | 12                   | Time after the warning before closing.               |

**Channel Naming** can use `%number%`, `%number_padded%`, `%user%`, `%display_name%`, `%user_id%`, `%category%`, `%category_label%`, `%panel%`, `%priority%`, `%server%`, `%date%`, `%day%`, `%month%` and `%year%`.

## Commands

| Command                                        | What it does                                                                                |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `/ticket open <user> <panel> <category>`       | Open a ticket for a member. Staff only.                                                     |
| `/ticket claim`                                | Claim the ticket.                                                                           |
| `/ticket unclaim`                              | Release the ticket.                                                                         |
| `/ticket close now [ticket] [reason] [silent]` | Close a ticket. With `silent`, the member is not sent the transcript.                       |
| `/ticket close request [reason]`               | Ask for the ticket to be closed.                                                            |
| `/ticket action raise <tier>`                  | Raise the ticket to a tier.                                                                 |
| `/ticket action lower <tier>`                  | Lower the ticket to a tier.                                                                 |
| `/ticket priority <priority>`                  | Change the priority.                                                                        |
| `/ticket inactivity whitelist`                 | Exempt the ticket from inactivity closing.                                                  |
| Open Ticket                                    | Right-click a member, then **Apps > Open Ticket**. Off by default on the **Commands** page. |

`/leaderboard` has **Tickets Opened**, **Tickets Claimed** and **Messages in Tickets** boards. The **Ticket Events** log records opens, closes, claims, tier and priority changes, close requests and inactivity closes.
