# Build a board of everything under an epic

The *Payments platform* epic spans four teams. The stories under it live in
different area paths, different iterations, sometimes different projects. The
question, *"show me every story under this epic, as a board"*, has no native
answer: board membership comes from a team's area paths, never from a hierarchy,
and the native board's Parent filter reaches exactly one level up.

This is the case AnyKanban was built for, and it takes four steps and no
query.

## Build it

1. **New board**, then pick **Everything under one item** from the gallery.
2. Type the epic's **id**, or part of its title, and choose it from the hits.
   An item in another project works: an id search is not scoped to one.
3. Under **Cards are**, choose the level that becomes the cards. On a Scrum
   process that is Product Backlog Item; on Agile, User Story.
4. Read the line above the button, which says how many items are under that
   root right now, and select **Create board**.

That is all. AnyKanban writes the recursive tree query for you, and the board
carries that query itself: **nothing is saved into your Queries**, so you need
no permission on any folder.

## What you get

- **The whole subtree, at any depth.** A story three levels below the epic
  arrives exactly like a direct child.
- **One level on the wall.** The epic itself, the features between it and your
  stories, and the tasks below them are the tree's *structure*. The board
  counts them and says so above the columns. It never shows them as cards and
  never drops them silently.
- **Backlog order across every parent.** Cards sort by the backlog's own rank,
  so the board reads the way the backlog does, and by default that rank is
  **read-only** here: no drag on this board rewrites a product owner's
  prioritization unless someone turns on **Reorder from this board** in the
  board's settings, a choice
  [Why we never write to your backlog](https://anykanban.com/docs/concepts/why-we-never-write-to-your-backlog/)
  explains.
- **Nothing frozen.** Move a story under a different feature in the same epic
  and it stays; move it out of the epic entirely and it leaves on the next
  refresh.

Reopening the board's settings names the item it was built from, as *Everything
under Epic 1234 · Payments platform*, with the query itself below it.

## When you want the query instead

The card covers one root and the hierarchy beneath it. Write the query by hand
when you want something the card does not offer:

- **several roots at once**, say two epics on one board;
- a **shared, editable** query other people can iterate on;
- extra clauses, such as excluding a state or an area path.

The query, if you write it by hand:

```sql
SELECT [System.Id], [System.Title], [System.State]
FROM workItemLinks
WHERE ([Source].[System.Id] = 1234)
  AND ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward')
MODE (Recursive)
```

Replace `1234` with your epic's id; for several roots use
`[Source].[System.Id] IN (1234, 5678)`. Save it as a **Tree of work items**
query and put it on a named board. Any template's query can also be edited
under **Advanced** before you create the board. Azure DevOps checks it as you
type, and a query it refuses cannot be saved.

## If something looks wrong

| What you see | Why |
|---|---|
| The card is not offered | The process has no requirement backlog level, so there is no level to board beneath a portfolio item. |
| The board is empty | Nobody has broken the epic down yet. That is an answer rather than a failure, and the board fills as work arrives. |
| Fewer cards than you expect | Some items sit in a project you cannot read. The board says how many it could not load rather than miscounting. |
| Cards in an order you did not choose | The type carries no backlog order field, so the board keeps the order the query returned. The confirmation said so before you created it. |
