Breadcrumbs

Count open child items

📚

This template displays the number of work items that are not in statuses with the Done status category and whose parent is the current work item.

Configuration

To use the Count open child items template, simply select it from the template grid. Filter by Status 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:

%{count(issuesFromJQL("statusCategory in ('To Do','In Progress') and parent = " + %{issue.key}))} 

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?

The expression counts how many open child work items (not in a "Done" status category) are connected to the current work item.

2. Step-by-step breakdown

Let’s break it down:

  • %{...}: This syntax is used to evaluate the expression dynamically.

  • issuesFromJQL(...): This function runs a JQL (Jira Query Language) search to find work items that match certain criteria.

  • "statusCategory in ('To Do','In Progress') and parent = " + %{issue.key}: This is the JQL query. It looks for work items that:

    • Are in the "To Do" or "In Progress" status categories (i.e., not completed).

    • Have the current work item as their parent (using %{issue.key} to refer to the current work item’s key).

  • count(...): This function counts the number of work items returned by the issuesFromJQL function.

3. Examples

Suppose you have a work item called "PROJ-123" with three child work items:

  • "PROJ-124" (status: To Do)

  • "PROJ-125" (status: In Progress)

  • "PROJ-126" (status: Done)

The expression will:

  • Find "PROJ-124" and "PROJ-125" (because they are not Done and have "PROJ-123" as their parent).

  • Count them, resulting in a value of 2.

4. Real-life use cases

  • Project Management: Quickly see how many tasks under a parent work item are still open, helping you track progress at a glance.

  • Sprint Planning: Identify how many sub-tasks or child work items remain to be completed for a larger work item.

  • Reporting: Use this count in dashboards or reports to monitor workload distribution or bottlenecks in your process.