Work item hierarchy

In this example we start from a list of work items and group them by parent two times.

Template

{{!--  we have a list of PBIs here, group them by parent  --}}

{{#group 'parent' orderBy="title"}}

{{!--  now we have a variable called 'groups' containing the groups
of PBIs. As we group by parent these are basically our features  --}}

{{!-- we group those groups again by parent to get to the epic level  --}}

{{#group groups 'parent' orderBy="title"}}

{{!-- now 'groups' contains our Epics. We can iterate over those
with the standard handlebars #each helper  --}}

{{#each groups}}

{{!-- as we grouped by parent each group is a work item so we
can use the fields and other work item helpers as usual  --}}

{{!-- some features might not have a parent epic so we check if
work item fields actually exist  --}}
{{#if fields}}
## Epic: {{ field 'Title' }}
{{else}}
## No Epic assigned
{{/if}}

{{!-- each group contains the list of original work items. These
are accessible via the #workItems helper. Here we are in the scope
of an epic so #workItems will list the features of that Epic  --}}

{{#workItems}}
{{#if fields}}
### Feature: {{ field 'Title' }}
{{else}}
### No Feature assigned
{{/if}}
Stories:

{{!-- the same as above we just go one level down and list the stories of
each feature  --}}

{{#workItems}}
  - {{ field 'Title' }}
{{/workItems}}

{{/workItems}}

{{/each}}
{{/group}}
{{/group}}

Work items

IdTitleWorkItemTypeParent
100🍇Story 100User Story30🍐
200🍈Story 200User Story30🍐
300🍊Story 300User Story40🥭
400🍋Story 400User Story40🥭
500🍌Story 500User Story50🍒
600🍏Story 600User Story60🍓

Other work items

IdTitleWorkItemTypeParent
1🍎Epic 1Epic
2🍍Epic 2Epic
30🍐Feature 1aFeature1🍎
40🥭Feature 1bFeature1🍎
50🍒Feature 2aFeature2🍍
60🍓Feature 2bFeature2🍍

Result

Epic: 🍍Epic 2

Feature: 🍒Feature 2a

Stories:

  • 🍌Story 500

Feature: 🍓Feature 2b

Stories:

  • 🍏Story 600

Epic: 🍎Epic 1

Feature: 🍐Feature 1a

Stories:

  • 🍇Story 100
  • 🍈Story 200

Feature: 🥭Feature 1b

Stories:

  • 🍊Story 300
  • 🍋Story 400