This template displays the name of all components in the sub-tasks of the current work item.
Repetitions will be omitted.
If there is nothing to display, the result will be “None”.
Configuration
To use the Components from all sub-tasks template, simply select it from the template grid. Filter by Sub-task to find it faster.
Parameters
This template does not require any additional parameter configuration.
Expert mode
If you switch to Expert mode you can see the formula field in the Expression Parser. You can now tweak the expression to create a custom formula field based on this template.
Expression
General expression:
%{distinct(fieldValue(%{issue.components}, subtasks()))}
Used parser functions
The links lead to the JWTC documentation because the parser functions are shared functionalities.
Details
1. What does the expression do?
The expression gathers all the components listed in the sub-tasks of the current work item, removes any duplicates, and returns the unique component names. If there are no components to show, the field will display “None”.
2. Step-by-step breakdown
Let’s break it down:
-
subtasks(): This parser function retrieves all the sub-tasks that belong to the current work item. -
fieldValue(%{issue.components}, ...): For each sub-task found, this function extracts the value of the Components field (i.e., the components of each sub-task). -
distinct(...): This function takes the list of components from all sub-tasks and removes any duplicates, so each component appears only once in the final result.
3. Examples
Suppose you have a work item with three sub-tasks:
-
Sub-task 1: Components = "Frontend"
-
Sub-task 2: Components = "Backend"
-
Sub-task 3: Components = "Frontend"
The expression will collect all components: "Frontend", "Backend", "Frontend". After removing duplicates, the result will be: "Frontend, Backend".
If none of the sub-tasks have components, the result will be: "None".
4. Real-life use cases
-
You want to quickly see which components are being worked on across all sub-tasks of a larger work item, without seeing the same component listed multiple times.
-
Project managers or team leads can use this to get an overview of which parts of the project (components) are involved in the sub-tasks, helping with resource allocation or progress tracking.
-
When preparing reports or dashboards, this expression helps summarize component involvement at a glance.