Breadcrumbs

Sum of time spent of blocking work items

๐Ÿ“š

Return the sum of the time spent of the linked work items linked to the current work item with the link type "is blocked by" in hours.

Configuration

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

Expression

%{sum(append(fieldValue({issue.timeSpent},linkedIssues("is blocked by")), [0]))/60}

If the resulting number from the expression contains too many decimal numbers, feel free to select one of the available display formats or to configure it manually.

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 time spent (in hours) on all work items that are linked to the current work item with the link type "is blocked by". In other words, it sums up the time spent on all blocking work items and converts the result from minutes to hours.

2. Step-by-step breakdown

Letโ€™s break it down:

  • linkedIssues("is blocked by"): Finds all work items that are linked to the current work item with the link type "is blocked by".

  • fieldValue({issue.timeSpent}, ...): For each of those linked work items, retrieves the value of the "time spent" field (the total time logged on each work item, in minutes).

  • append(..., [0]): Adds a zero to the list of time spent values. This ensures that if there are no linked work items, the sum will be zero instead of causing an error.

  • sum(...): Adds up all the time spent values (including the zero).

  • /60: Divides the total by 60 to convert the result from minutes to hours.

  • %{ ... }: This syntax is used to interpret the elements within as advanced expressions.

3. Examples

  • If the current work item is blocked by two other work items, and those have 120 and 90 minutes logged respectively, the calculation would be:

    • (120 + 90 + 0) / 60 = 210 / 60 = 3.5 hours

  • If there are no blocking work items, the result will be:

    • (0) / 60 = 0 hours

4. Real-life use cases

  • A project manager wants to see how much effort has already been spent on all tasks that are blocking a particular work item, to better estimate when the current work item might be unblocked.

  • A team lead wants to report on the total time invested in resolving blockers for a key deliverable.

  • In a dashboard, you could display this value to highlight bottlenecks or areas where significant effort is being spent on blockers.