This template displays the days elapsed from the date selected in the date and time field of your choice until now.
If the field does not have a value, “None” will be displayed.
For the parameter Date and time, pick the Date and time field that should be compared against the current time.
Configuration
To use the Time 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.
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 ? {system.currentDateTime} - {issue.cfNNNNN} : null}
NNNNN is the ID of the custom field you chose for the “Date picker” parameter.
Display as
Duration
Formatting style
short
Details
1. What does the expression do?
The purpose of this expression is to calculate the duration between a specific date and time stored in a custom field and the current moment. It essentially tracks how much time has passed since a specific event occurred. If the date and time field is empty, the expression returns "None" to avoid errors or misleading data.
2. Step-by-step breakdown
The general expression used is:
%{%{issue.cfNNNNN} != null ? {system.currentDateTime} - {issue.cfNNNNN} : null}
-
%{ ... }: This is the expression wrapper. It tells the Expression parser to evaluate the logic contained within the brackets. -
issue.cfNNNNN != null: This is a conditional check. It looks at the specific custom field (whereNNNNNis the unique ID of your chosen field) to see if it contains a value.-
Work item (Issue): In this context,
issuerefers to the specific work item the field is being calculated for.
-
-
? ... : ...: This is a Ternary Operator (a shorthand for an If/Else statement).-
If the condition before the
?is true (the field is not empty), it executes the first part. -
If the condition is false (the field is empty), it executes the part after the
:.
-
-
{system.currentDateTime} - {issue.cfNNNNN}: This is the core calculation.-
system.currentDateTime: A technical term for a system variable that captures the exact current date and time. -
The expression subtracts the date in the work item's custom field from the current time to find the difference.
-
-
null: If the field is empty, the expression returnsnull, which the system displays as "None".
3. Examples
-
Scenario A (Date is set): A work item has a "Last Status change" field set to June 1, 2026 13:00. If today is June 10, 2026 14:45, the expression calculates the difference.
-
Result: 9 days 1 hour and 45 minutes (displayed as a duration, e.g., "9d 1h 45m").
-
-
Scenario B (Field is empty): A work item has no value in the "Last Status Change" field.
-
Result: None.
-
4. Real-life use cases
This expression is particularly useful for monitoring timelines and aging within your Jira instance:
-
SLA & Aging: Track how many days a work item has been in its current state by comparing a "Last Status Change" date to the current time.
-
Onboarding Timelines: For HR or IT teams, track how many days have elapsed since a "Hire Date" to ensure equipment and access are provided on time.
-
Compliance: Monitor how long a "Security Review" has been pending to ensure it doesn't exceed regulatory deadlines.
-
Project Management: Calculate the time elapsed since a "Project Kickoff" date to compare against the planned schedule.