> ## Documentation Index
> Fetch the complete documentation index at: https://developers.reintersect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ticket

> A ticket card with status, priority, tags and assignee. Use it as an inserted block or as the block for links to your tracker.

> Reintersect apps are in developer preview. Names and limits can still change before general
> release.

To show a work item from your tracker, such as an issue, use a ticket block. Insert it directly, or
make it the block for your tracker's links, so a pasted link shows the ticket.

```tsx src/app.ts theme={null}
import { createReintersectApp, defineReference } from "@reintersect/sdk/app";
import { ticket } from "@reintersect/sdk/recipes";

export const Issue = ticket({ type: "issue", title: "Issue" });

export const IssueLink = defineReference("issue", {
  patterns: { issue: "https://tracker.example.com/:key" },
  block: Issue,
  resolve: ({ params }) => ({
    externalId: params.key,
    title: `Issue ${params.key}`,
    block: {
      props: {
        key: params.key,
        title: "Printer jam on floor 3",
        assignee: "Grace",
        priority: "high" as const,
        tags: [{ name: "hardware", color: "#d97706" as const }],
      },
      state: { status: "in_progress" as const },
    },
  }),
});

export const app = createReintersectApp({ name: "Tracker" })
  .addBlock(Issue)
  .addReference(IssueLink);
```

## Props, state and actions

Props are `{ key, title, url?, assignee?, priority?, tags? }`, where `priority` is `low`, `medium`,
`high` or `urgent` and each tag is `{ name, color? }` with a `#rrggbb` colour. State is
`{ status: "open" | "in_progress" | "done" | "closed" }`.

| Action | Behaviour |
| - | - |
| `move` | Takes `{ status: "open" \| "in_progress" \| "done" }`: start, finish or reopen the ticket. |
| `close` | Destructive. Closes the ticket. |

The ticket key and tags sit on one line as chips, and a tag with a colour gets a swatch dot. Start
work, Mark done or Reopen is the primary button. Close ticket is destructive, so it asks first and
is never primary. On a closed ticket, the Open ticket link leads instead.

The actions change the block's stored state. To change the ticket in your tracker too, write your own
actions around the exported `TicketView`, or update the tracker from an event and push state back.

## Labels

`status`, `priority`, `assignee`, `priorityLabel`, `unassigned`, `start`, `done`, `reopen`, `close`,
`confirmTitle`, `open`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.