# Linking tickets

Two tickets often belong together: one has to be done before the other can go on, or two
tickets describe the same thing. A **relation** records that on the ticket.

## Create a relation

1. Open the ticket and choose **Link** in the **"…" menu** at the top right. If the ticket
   already has relations, **+ Link** at the end of the **Relations** section works as well.
2. Choose the **relation**.
3. Type the number or part of the title into the **Ticket** field. The list shows matching
   tickets with their project.
4. Pick a ticket and click **Link**.

You need write access to tickets in the project of the open ticket, and read access to the
other ticket.

## The kinds

| Kind | Meaning |
|---|---|
| **blocks** / **is blocked by** | The blocked ticket cannot be **finished** while the other one is open. |
| **precedes** / **follows** | The following ticket cannot **start** before the other one is done. |
| **relates to** | The tickets belong together without waiting for each other. |
| **duplicates** / **is duplicated by** | Both tickets describe the same thing. |

Each relation shows on both tickets, read from that ticket's side: "A blocks B" appears on B
as "is blocked by A".

With **precedes** and **follows** you can enter a **gap in days**. Lalabase shows it, for
example as "+3 days", but **moves no date**: tickets have no start date that could move.

There are no circles: if A waits for B, B cannot also wait for A, neither directly nor
through other tickets. Lalabase refuses such a relation with a message.

Relations change no status. A ticket may be finished while it still waits, and a duplicate
is not closed by itself.

## Waiting on

When a ticket waits for an open ticket (**is blocked by** or **follows**), the header shows
**Waiting on** next to the metadata, with the number and title of the other ticket. If it
waits on several, the hint shows the count, and a click jumps to the **Relations** section.
Once the other tickets are done, or the ticket itself is, the hint goes away.

## In the list, on the board and on a phone

You can see that a ticket waits without opening it. The sign for it is an **hourglass**.

- **Ticket list:** In the column picker you can add the **Waiting** column. It shows the
  hourglass and the number of open tickets the ticket waits on. Tickets that wait on nothing,
  and done tickets, stay empty. The column is not shown by default, and the list cannot be
  sorted by it.
- **Board:** The card of a waiting ticket shows the hourglass next to its number, without a
  count.
- **Phone:** In the ticket list the hourglass stands next to the number.

The board and the phone always show the hourglass, whatever columns you chose. When you point
at the hourglass, it tells the count, for example **Waiting on 2 open tickets**.

Tickets are counted, not relations: a ticket that blocks and also precedes counts once. The
count includes tickets in projects you may not see. The list, the board and the phone never
say which tickets they are, not even when you point at the hourglass. You find the ones you
can see in the open ticket.

## Filtering: Waiting and Blocking

In the ticket list, **+ Filter** offers two conditions for this:

- **Waiting:** tickets that wait on at least one open ticket, marked **is blocked by** or
  **follows**.
- **Blocking:** tickets that at least one open ticket waits on.

Both have a single value. With **is** the list shows the tickets in that state, with
**is not** all the others, done tickets included. The condition then says **yes** or **no**,
for example **Waiting: no**, and the sentence above the list reads, for example, “Only tasks
that are waiting on an open ticket.”

Only open tickets count, at both ends: a done ticket does not wait and holds nobody up, and
nobody waits on a done ticket. What done means is decided for each ticket by the statuses of
its own project. The kinds **relates to** and **duplicates** do not count.

**Blocking** counts even when the waiting ticket lies in a project you may not see, and
**Waiting** counts a blocker you cannot open as well. The list still shows only tickets you
see anyway, and does not name the other ticket.

You can combine both conditions with others, such as status and tags, and
[save them as a view](https://lalabase.com/docs/en/guides/ticket-views/saved-filters). When you open the view again, they are
there as before. The filters exist for tickets only, not for notes, documents or meetings.

## The Relations section

As soon as a ticket has a relation, it shows the **Relations** section above the history.
It groups the linked tickets into **Waiting on**, **Blocks / precedes**, **Related** and
**Duplicates**. Done tickets are greyed out at the end of their group.

If a linked ticket is in another project, the project is shown next to it, and a click
opens the ticket in its own project. The **✕** at the end of a row removes the relation.
That works on both tickets.

## Across projects

Relations cross projects, but never leave your organisation. A ticket in a project you may
not see appears nowhere with its title, number or project, not even in the search when
linking. If a ticket waits on such a ticket, the hint only says **Waiting on 1 ticket you
cannot open**.

## When the display changes

When you create or remove a relation, the section and the hint of the open ticket change
right away, and so do its row in the ticket list next to it and its card on the board.

Next to an open ticket the list often has room for the number and the title only. You see the
**Waiting** column there only if you **pin** it in the column picker: its value then stands
under the title, for example **Waiting on 1**. Otherwise the row shows the change as soon as
you close the ticket.

The rows and cards of **other** tickets change after a reload. That includes the linked
ticket and other open pages, such as a second window. When a ticket that others wait on is
finished, their rows keep the hourglass until you reload the list. The same goes for a list
filtered by **Waiting** or **Blocking**.

Relations do not appear in the history and send no notification.
