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
Id | Title | WorkItemType | Parent |
---|---|---|---|
100 | 🍇Story 100 | User Story | 30🍐 |
200 | 🍈Story 200 | User Story | 30🍐 |
300 | 🍊Story 300 | User Story | 40🥭 |
400 | 🍋Story 400 | User Story | 40🥭 |
500 | 🍌Story 500 | User Story | 50🍒 |
600 | 🍏Story 600 | User Story | 60🍓 |
Other work items
Id | Title | WorkItemType | Parent |
---|---|---|---|
1 | 🍎Epic 1 | Epic | |
2 | 🍍Epic 2 | Epic | |
30 | 🍐Feature 1a | Feature | 1🍎 |
40 | 🥭Feature 1b | Feature | 1🍎 |
50 | 🍒Feature 2a | Feature | 2🍍 |
60 | 🍓Feature 2b | Feature | 2🍍 |
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