> From the BotGhost docs: https://botghost.com/docs/custom-commands-and-events/actions/ticket-actions
> Every page: https://botghost.com/docs/llms.txt

# Ticket Actions

Open, change, close and find tickets from your own commands and events.

Five blocks that work with the [Tickets](https://botghost.com/docs/server-management/tickets) module, so you can add your own commands and events around it, like a /claim command or a button that closes a ticket.

> **Note:** Turn on Tickets and save it first. Until then, these blocks are locked and the builder shows **Set up Tickets**. Each block uses the ticket types, panels and staff from your Tickets page.

Every ticket block has **paths**: one for each way it can end, such as **Opened** and **Couldn't open**. Add blocks under each path to reply in each case.

## Open a Ticket

Opens a ticket for a member.

![The Open a Ticket settings, with the ticket type, Who is it for, the checks, the answers to save and the paths marked](https://botghost.com/docs/content/assets/workspace/block-open-ticket-1.png)

- **A** **Which kind of ticket**: one of your ticket types, a type picked while the block runs (from an option or a variable), or **Set it up on this block** (where it opens, who answers and its name).
- **B** **Who is it for**: the member who used it, or someone else.
- **C** **Run the checks first**: the type's limits, wait time, blocked roles and support hours. Leave it off when the **Ticket Requested** event has already checked.
- **D** **Answers to save**: answers from a form before this block, so staff see them in the ticket.
- **E** The paths: **Opened** and **Couldn't open**.

![The variables Open a Ticket gives the blocks after it](https://botghost.com/docs/content/assets/workspace/block-open-ticket-2.png)

- **A** Use these in blocks after it. `{ticket_refusal}` says why it couldn't open, on that path.

## Change a Ticket

Everything staff do in a ticket, in one block.

![The Change a Ticket settings, with the tabs, the changes, Which ticket, the rules and the paths marked](https://botghost.com/docs/content/assets/workspace/block-change-ticket.png)

- **A** The groups of changes.
- **B** The change to make. Each group has its own:
  - **Who has it**: claim it, unclaim it, hand it to someone, or escalate (bring in senior roles and raise the priority).
  - **People**: add or remove a member or role, or make it private (only the claimer and senior roles see it).
  - **Sorting**: priority (Low, Normal, High or Urgent), move it to another type, a label like bug or refund, or whose turn it is.
  - **Tidying**: rename it (Discord allows 2 renames every 10 minutes), lock it, write a staff note, send a saved reply, pause its timers, or reopen it.
  - **The member**: block or unblock them from opening tickets, or leave a note that shows on their next tickets.
- **C** **Which ticket**: the one it's used in, or find it by number or channel.
- **D** **Only staff can do this**: anyone else goes down **Not allowed**. **Say it in the ticket** posts what changed.
- **E** The paths: **Done**, **Not a ticket** and **Not allowed**.

## Close a Ticket

![The Close a Ticket settings, with What should happen, Ask first, Reason and Then marked](https://botghost.com/docs/content/assets/workspace/block-close-ticket.png)

- **A** **What should happen**: close it (the member loses access, and it can be reopened), delete it after the transcript is saved, or do what the Tickets page says.
- **B** **Ask first**: close straight away, or ask the member to agree.
- **C** **Reason**: none, or one you set here.
- **D** **Then**: save a transcript, ask for a rating, close quietly (no message in the ticket or to the member), and whether only staff can do it.

Below these, pick which ticket. The paths are **Closed**, **Kept open**, **Not a ticket** and **Not allowed**. `{ticket_transcript}` is the transcript's link and `{close_reason}` the reason.

## Post a Ticket Panel

Posts the message people press to open a ticket, or updates one already posted.

![The Post a Ticket Panel settings, with What should it show, the channel and Update the old one instead marked](https://botghost.com/docs/content/assets/workspace/block-post-ticket-panel.png)

- **A** **What should it show**:
  - **This server's own panel**: the panel the server has on the Tickets page. One block works for every server.
  - **A panel set for All servers**: the same panel wherever it runs.
  - **Only some ticket types**: pick which buttons it shows.
- **B** **Channel**: leave it empty to post in the panel's own channel.
- **C** **Update the old one instead**: edits the message already there, so nobody has to repost it.

The panel's buttons never stop working. `{ticket_panel_message_id}` is the new message's ID.

## Find a Ticket

Looks a ticket up so you can use its details in the blocks after it, for example in a /ticket-info command.

![The Find a Ticket settings, with Find it by, the name, the paths and the ticket variables marked](https://botghost.com/docs/content/assets/workspace/block-find-ticket.png)

- **A** **Find it by**: a member (their open ticket or their latest), a number, a channel, the channel it's used in, or a member's earlier tickets.
- **B** **Name**: what you call it in later blocks, `ticket` to start with.
- **C** The paths: **Found** and **Not found**.
- **D** Its details, such as `{ticket.number}`, `{ticket.member}`, `{ticket.status}` (open, waiting or closed), `{ticket.claimed_by}` and `{ticket.priority}`.
