Breadcrumbs

Number of work items with the same fix versions

📚

Return the total number of work items with any of the fix versions selected in the current work item.

Configuration

Create a Custom smart number field and use the General parsing mode.

Expression

%{%{issue.fixVersions} != null ? count(issuesFromJQL("fixVersion in ('" + 
jiraExpression( "issue?.fixVersions?.map(v =>  v?.name).join(\"','\") ") + "') "))
 : null}

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?

This expression calculates the total number of work items (such as tasks, bugs, or stories) that share any of the same fix versions as the current work item. In other words, it tells you how many other work items are planned to be fixed in the same release(s) as the one you are viewing.

2. Step-by-step breakdown

Let’s break it down:

  • %{ ... }: This marks the start and end of the advanced parser expression.

  • %{issue.fixVersions} != null ? ... : null: This checks if the current work item has any fix versions set. If not, the result is null (None is shown).

  • jiraExpression( "issue?.fixVersions?.map(v => v?.name).join(\"','\") "):

    • This part collects the names of all fix versions assigned to the current work item and joins them into a single string, separated by commas and single quotes. For example, if the fix versions are "1.0" and "2.0", it produces: 1.0','2.0.

  • "fixVersion in ('" + ... + "') ":

    • This adds the missing single quotes to the first and last fix versions from the previous excerpt and builds a JQL query to find all work items with any of those fix versions.

  • issuesFromJQL(...):

    • This function runs the JQL search and returns all matching work items.

  • count(...):

    • This counts how many work items were found by the search.

3. Examples

Suppose the current work item has two fix versions: "Release 1.0" and "Release 2.0".

  • The expression will search for all work items that have either "Release 1.0" or "Release 2.0" as a fix version.

  • If there are 5 work items with "Release 1.0" and 3 with "Release 2.0" (some may overlap), the expression will count the total number of unique work items matching either fix version.

4. Real-life use cases

  • Release planning: Quickly see how many work items are scheduled for the same release as the current one, helping with workload balancing and release management.

  • Quality assurance: Identify the scope of testing required for a particular release by knowing how many work items are included.

  • Progress tracking: Monitor how many work items are associated with a specific fix version to track release readiness.