Breadcrumbs

Time spent in linked work items

📚

This template displays the sum of the time spent in the work items linked to the current work item with any link type.

Configuration

To use the Time spent in linked work items template, simply select it from the template grid. Filter by KPI 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:

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

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 calculates the total time spent (in minutes) across all work items that are linked to the current work item, regardless of the link type.

2. Step-by-step breakdown

Let’s break it down:

  • linkedIssues(): This parser function gets all work items that are linked to the current work item.

  • fieldValue({issue.timeSpent}, linkedIssues()): For each linked work item, this retrieves the value of the “Time Spent” field (the amount of time logged on each linked work item).

  • append(..., [0]): This adds a zero to the list of time spent values to prevent errors.

  • sum(...): Adds up all the values in the list (the total time spent across all linked work items).

  • / 60: Converts the total time from minutes (the default unit for time spent in Jira) to hours.

3. Examples

  • If you have three linked work items with 120, 180, and 60 minutes logged as time spent, the calculation would be:

    • sum([120, 180, 60, 0]) = 3600 seconds

    • 360 / 60 = 6 hours

  • If there are no linked work items, the list is [0], so the sum is 0 and the result is 0 minutes.

4. Real-life use cases

  • A project manager wants to see how much time has been spent on all linked work items.

  • You want to track the total effort spent on all work items linked to a specific feature or bug.