Days elapsed

📚

This template displays the days elapsed from the date selected in the date field of your choice until today.

If the field does not have a value, “None” will be displayed.

For the parameter Date field, pick the Date field that should be compared against the current day.

Configuration

To use the Days elapsed template, simply select it from the template grid. Filter by SLA, aging & compliance timelines to find it faster.

Parameters

To complete the configuration, select values for all parameters.

grafik-20250602-091901.png

Edit formula mode

If you click on Edit formula 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:

%{%{issue.cfnnnnn} != null ? datePart({system.currentDateTime},RUN_AS_LOCAL) - datePart({issue.cfnnnnn},RUN_AS_LOCAL) : null}

NNNNN is the ID of the custom field you chose for the “Date picker” parameter.

Display as

Duration

Formatting style

short

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 purpose of this expression is to calculate the number of days that have passed between a date stored in a specific custom field (the "Date field") and today's date. If the date field is empty, the expression returns nothing ("null"), which results in "None" being displayed to the user.

2. Step-by-step breakdown

The expression is:
%{%{issue.cfnnnnn} != null ? datePart({system.currentDateTime},RUN_AS_LOCAL) - datePart({issue.cfnnnnn},RUN_AS_LOCAL) : null}

  • %{ ... }: This is the wrapper for the expression, telling the system to evaluate the logic inside.

  • issue.cfnnnnn != null: This checks if the custom field (where nnnnn is the ID of your chosen date field) actually contains a value. It ensures the calculation only runs if there is a date to compare.

  • ? ... : ...: This is a conditional operator (often called an "If/Else" statement). If the condition before the ? is true, it runs the first part; otherwise, it runs the part after the :.

  • datePart({system.currentDateTime}, RUN_AS_LOCAL):

    • system.currentDateTime: This represents the exact moment the calculation is happening (today).

    • datePart(..., RUN_AS_LOCAL): This function extracts the date portion (ignoring the specific time) and adjusts it to your local time zone.

  • - datePart({issue.cfnnnnn}, RUN_AS_LOCAL): This subtracts the date in your custom field from today's date. Because it uses datePart, it calculates the difference in full days.

  • : null: If the custom field was empty, this part is triggered, returning no value.

3. Examples

  • Scenario A (Date exists): If today is June 8, 2026, and your "Date field" (e.g., "Start Date") is set to June 1, 2026, the expression calculates June 8 - June 1.

    • Result: 7

  • Scenario B (Empty field): If the "Start Date" field is empty.

    • Result: None (or null)

4. Real-life use cases

This expression is highly useful for tracking timelines and aging within your work items:

  • SLA Tracking: Calculate how many days a work item has been open since its "Created" date to ensure it meets service level agreements.

  • Aging Reports: Identify how many days a work item has been sitting in a "Waiting for Customer" status by comparing a "Status Changed" date field to today.

  • Project Milestones: Track how many days have passed since a specific project milestone was reached (e.g., "Days since Go-Live").