Return the number of sub-tasks in the Done or Complete statuses.
Configuration
Create a Custom smart number field and use the General parsing mode.
Expression
%{count(filterByStatus(subtasks(), "Done, Completed"))}
You can also adapt this expression by changing the status names (e.g., to "In Progress" or "To Do") to fit your specific workflow needs.
Display as
Number
Formatting style
Default (unformatted)
Used parser functions
The links lead to the JWTC documentation because the parser functions are shared functionalities.
Details
1. What does the expression do?
It calculates the number of sub-tasks that are in either the "Done" or "Completed" status.
2. Step-by-step breakdown
-
subtasks(): This function retrieves all sub-tasks of the current work item. -
filterByStatus(subtasks(), "Done, Completed"): This filters the list of sub-tasks, keeping only those whose status is either "Done" or "Completed". -
count(...): This counts how many sub-tasks remain after filtering—i.e., how many sub-tasks are in the "Done" or "Completed" status. -
%{ ... }: This syntax is used to interpret the elements within as functions.
3. Examples
-
If a work item has 5 sub-tasks, and 3 of them are in "Done" or "Completed" status, the expression will return
3. -
If none of the sub-tasks are in those statuses, it will return
0.
4. Real-life use cases
-
Progress tracking: Display how many sub-tasks of a parent work item have been finished, helping teams quickly see progress.
-
Custom reporting: Use this number in dashboards or reports to highlight completed work at a glance.