Breadcrumbs

Count components

📚

This template displays the number of components in the current work item.

Configuration

To use the Count components template, simply select it from the template grid. Filter by Misc 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

Jira expression:

issue.components.length

Display as

Number

Formatting style

Default (unformatted)

Details

1. What does the expression do?

The expression calculates the number of components set in the current work item.

2. Step-by-step breakdown

  • issue: Refers to the current work item (previously called "issue" in Jira).

  • components: Refers to the field values within the work item of the Components field.

  • length: This is a property that returns the total number of items in a list or array.

So, issue.components.length means: "Count how many components are set in this work item."


3. Examples

  • If a work item has 3 components (e.g., "Frontend", "Backend", "API"), the expression will return 3.

  • If a work item has no components, the expression will return 0.


4. Real-life use cases

  • Project reporting: Quickly see how many components are involved in a particular work item to understand its complexity or scope.

  • Quality checks: Identify work items that are missing components (where the count is 0).

  • Custom dashboards: Display the number of components per work item in a report for better project tracking.