Available JQL functions for working with time and examples of their use.
- This help is available from jiraās help menu:
- You might need a work calendar. You can see their list in the system by following the link from the help menu or this link {baseUrl}/secure/jibrokAllCalendars!default.jspa:
Arguments used in functions.
"5h35m12s" - 5 hours 35 minutes 12 seconds
"5h12s" - 5 hours 12 seconds
3000m - 3000 minutes
"0", "0s" ... - time is zero.
"<=", "<", "=", ">", ">="
Common
Time in status
Functions for searching issues by time spent in statuses. These functions are available by default. If not, please contact your Jira admin.
- issue in timeInStatus(āstatusesā, āconditionā, ātimeā) - Find issues that spent the specified time in statuses.
- Params:
- statuses - name or id, Comma separated
- issue in timeInStatusByJql(ājqlā, āstatusesā, āconditionā, ātimeā) - Find issues from a jql request that spent the specified time in statuses.
- Params:
- jql - query for filter tasks
- statuses - name or id, Comma separated
- issue in timeInStatusByJqlAndWorkCalendar(ājqlā, āstatusesā, āconditionā, ātimeā, ācalendarā) - Find issues from a jql request that spent the specified working time in statuses. Working hours will be calculated according to the specified calendar.
- Params:
- jql - query for filter tasks
- statuses - name or id, Comma separated
- calendar - work calendar name or id for calculate work time
- Examples:
- issue in timeInStatus(āDone, In Progressā, ā>ā, ā8hā)
- issue in timeInStatusByJqlAndWorkCalendar(āproject = TESTā, āDoneā, ā>ā, ā3hā, āGeneral calendarā)
- If several statuses are specified, the search is based on the sum of the time spent in the specified statues.
- Status names are case sensitive. If the name does not match, the function will prompt the correct spelling options for the status.
- Use āORā and āANDā to search different statues: issue in timeInStatus(āstatus Aā, ā>ā, ātimeā) or issue in timeInStatus(āstatus Bā, ā>ā, ātimeā)
- If possible use functions with jql. They narrow the search and execute faster.
Compare fields
Functions that allow you to compare different fields with each other. The functions work with ānumberā, āstringā and ātimeā fields. Returns issues whose fields satisfy the condition.
- issue in compareFields(āfield 1ā, āconditionā, āfield 2ā) - Field comparison function. Finds tasks in which fields match a condition.
- Params:
- āfield 1ā and āfield 2ā - field name or field id
- issue in compareFieldsByJql(ājqlā, āfield 1ā, āconditionā, āfield 2ā) - Field comparison function. Finds tasks in which fields match a condition and jql.
- Params:
- jql - query for filter tasks
- āfield 1ā and āfield 2ā - field name or field id
- Examples:
- issue in compareFields(āTime in status Newā, ā>ā, āTime in status In progressā)
- issue in compareFields(āNumber fieldā, ā>ā, āAnother number fieldā)
- issue in compareFields(āProject = TESTā, āString fieldā, ā>ā, āAnother number fieldā)
- If possible use functions with jql. They narrow the search and execute faster.
- In the case of string fields, the function will try to convert the string to a number for correct comparison.
Compare date from field and date by work calendar
The comparisonDateFromFieldAndDateByWorkCalendar function is used to compare a date from a specified field with a computed date based on a given relative time and a specified work calendar. The behavior of the function is as follows:
- comparisonDateFromFieldAndDateByWorkCalendar(āfieldā, āconditionā, ātimeā, ācalendarā)
- Params:
- āfieldā - The name of the field to be searched and compared. It can be the name or ID of a system field or a custom field.
- āconditionā - The condition for comparing the date from the first field with the computed date. Possible values are <, <=, =, >=, >.
- ātimeā - A string representing the time relative to the current time, entered in the format ā-1h 30mā, for example. This value is used to calculate the date based on the specified work calendar.
- ācalendarā - The name or ID of the work calendar. The computed date is calculated based on this calendar and the specified relative time.
Behavior:
- The function retrieves the value from the specified āfieldā.
- The current date is computed based on the specified āwork calendarā and the relative ātimeā relative to the current time. For example, if the current time is 9:00 AM and relativeTime is ā-1h 30mā (one and a half working hours ago), the computed date will represent 7:30 AM of the current working day according to the specified calendar.
-
The computed date is compared with the date from the specified āfieldā using the specified comparison operator (āconditionā). For example, if āconditionā is >, it checks if the date from the āfieldā is more than the computed date .
- Examples
- issue in comparisonDateFromFieldAndDateByWorkCalendar(āupdatedā, ā>ā, ā-1hā, āCalendar Nameā) - find all issues that have been updated for the last working hour(-1h) on the working calendar. Like: āupdated > -1hā, but -1h by work calendar.
Autotrack
Works if the automatic time tracking function is enabled.
- issue in myAutoTrackTickets() - Returns user issues with configured automatic timers or stopwatches.
Time in status (field)
If there is a configured field āTime in statusā, the following search functions are available for it.
You can check the field type with the administrator
Search by state
- āfield nameā in active() - Search by active time in status fields(issue in selected statuses)
- āfield nameā in inactive() - Search by inactive time in status fields(issue not in selected statuses)
Search by time
- āfield nameā in time(āconditionā, ātimeā) - Search by time in status fields(by total time in selected statuses)/Timer field. Time value from index.
- āfield nameā in realTime(āconditionā, ātimeā) - Search by time in status fields(by total time in selected statuses)/Timer field. Time value calculate realtime.
-
āfield nameā in realTimeBetween(ātimeā, ātimeā) - Search by realtime in status fields(by total time in selected statuses). Time value calculate realtime.
- Examples:
- āTime in newā in realTime(ā>ā, ā20mā) AND āFirst reactionā in realTime(ā<ā, ā1hā)
- āTime in newā in realTimeBetween(ā1hā, ā2hā)
Stopwatch
If there is a configured āStopwatchā field, the following search functions are available for it.
You can check the field type with the administrator
Search by state
- āfield nameā in isRunning() - Search issues by running stopwatch.
- āfield nameā in isPaused() - Search issues by paused stopwatch.
- āfield nameā in isStopped() - Search issues by stopped stopwatch.
- āfield nameā in active() - Returns issues that have a stopwatch is running. If the stopwatch uses a calendar, the field may indicate that it is not working hours. This does not affect the search if stopwatch is running.
-
āfield nameā in inactive() - Returns issues that have a stopwatch is pause, stopped.
- Examples:
- āFirst responseā in isRunning()
- āFirst responseā in isStopped()
Search by date
- āfield nameā in startInDay(ānumberā) - Search for issues by the day when the stopwatch was first started.
- āfield nameā in startInWeek(ānumberā) - Search for issues by the week when the stopwatch was first started.
-
āfield nameā in startInMonth(ānumberā) - Search for issues by the month when the stopwatch was first started.
- āfield nameā in stopInDay(ānumberā) - Search for issues by the day when the stopwatch was stopped.
- āfield nameā in stopInWeek(ānumberā) - Search for issues by the week when the stopwatch was stopped.
-
āfield nameā in stopInMonth(ānumberā) - Search for issues by the month when the stopwatch was stopped.
- āfield nameā in pauseInDay(ānumberā) - Search for issues by the day when the stopwatch was paused.
- āfield nameā in pauseInWeek(ānumberā) - Search for issues by the week when the stopwatch was paused.
-
āfield nameā in pauseInMonth(ānumberā) - Search for issues by the month when the stopwatch was paused.
- Examples:
- āFirst responseā in startInDay() - find the issues whose stopwatch has started today.
- āFirst responseā in startInDay(ā-1ā) - find the issues whose stopwatch started yesterday(1 day ago).
- āFirst responseā in startInDay(ā-7ā) - find the issues whose stopwatch started a week ago(7 days ago).
- āfield nameā in searchByStartDate(āconditionā, ādateā) - Search for issues by the date when the stopwatch was first started.
- āfield nameā in searchByPausedDate(āconditionā, ādateā) - Search for issues by the date when the stopwatch was last paused.
-
āfield nameā in searchByStopDate(āconditionā, ādateā) - Search for issues by the date when the stopwatch was stopped.
- date - date in āyyyy-MM-ddā or āyyyy-MM-dd HH:mmā format
- Examples:
- āFirst responseā in searchByStartDate(ā>ā, ā2021-01-01ā) - issues for which stopwatch started after ā2021-01-01ā
- āfield nameā in startInDateRange(ādateā,ādateā) - Search for issues by the date when the stopwatch was started (duration).
-
āfield nameā in stopInDateRange(ādateā,ādateā) - Search for issues by the date when the stopwatch was stopped (duration).
- Examples:
- āFirst responseā in stopInDateRange(ā2020-01-01ā, ā2021-01-01ā) - issues for which stopwatch stopped during 2020.
Search by time
- āfield nameā in timeSpent(āconditionā,ātimeā) - Search by time in timer fields(by total time spent). Time value from index.
- āfield nameā in realTimeSpent(āconditionā,ātimeā) - Search by real time in timer fields(by total time spent). Time value calculate realtime.
- āfield nameā in pauseTime(āconditionā,ātimeā) - Search by pause time in timer and stopwatch fields.
-
āfield nameā in realPauseTime(āconditionā,ātimeā) - Search by real pause time in timer and stopwatch fields.
- Examples:
- āFirst responseā in realTimeSpent(ā>ā, ā20mā)
- āFirst responseā in realPauseTime(ā<ā, ā20mā)
Other
- āfield nameā in searchByRestartCount(āconditionā,ānumberā) - Search for issues by the stopwatch count of restart.
- āfield nameā in searchByCalendar(ānumberā) - Search issues by calendar id.
- āfield nameā in searchByStopwatchConfig(ānumberā) - Search issues by stopwatch config id.
- āfield nameā in searchByStopwatchScheme(ānumberā) - Search issues by stopwatch scheme id.
Timer
If there is a configured āTimerā field, the following search functions are available for it.
You can check the field type with the administrator
Search by state
- āfield nameā in isRunning() - Search issues by running timer.
- āfield nameā in isPaused() - Search issues by paused timer.
- āfield nameā in isCompleted() - Search issues by completed timer.
- āfield nameā in isFailed() - Search issues by failed timer.
- āfield nameā in isFailedRealTime() - Search issues by failed timer.
- It takes into account not only the state of the timer after stopping(FAILED/COMPLETED), but also active timers that have run out of time but state is RUNNING.
- Examples:
- āFirst responseā in isFailed()
- āFirst responseā in isCompleted()
Search by date
- āfield nameā in startInDay(ānumberā) - Search for issues by the day when the timer was first started.
- āfield nameā in startInWeek(ānumberā) - Search for issues by the week when the timer was first started.
-
āfield nameā in startInMonth(ānumberā) - Search for issues by the month when the timer was first started.
- āfield nameā in stopInDay(ānumberā) - Search for issues by the day when the timer was stopped.
- āfield nameā in stopInWeek(ānumberā) - Search for issues by the week when the timer was stopped.
-
āfield nameā in stopInMonth(ānumberā) - Search for issues by the month when the timer was stopped.
- failInDay/week/month - function shows even running timers, taking into account the estimated completion date. It also shows timers that have āfailedā date +-N from the current day.
- āfield nameā in failInDay(ānumberā) - Search for issues by the day when the timer was failed.
- āfield nameā in failInWeek(ānumberā) - Search for issues by the week when the timer was failed.
-
āfield nameā in failInMonth(ānumberā) - Search for issues by the month when the timer was failed.
- āfield nameā in pauseInDay(ānumberā) - Search for issues by the day when the timer was paused.
- āfield nameā in pauseInWeek(ānumberā) - Search for issues by the week when the timer was paused.
-
āfield nameā in pauseInMonth(ānumberā) - Search for issues by the month when the timer was paused.
- Examples:
- āFirst responseā in failInDay() - find issues which time in āFirst responseā timer run out or will run out today
- āFirst responseā in failInDay(ā-1ā) - find issues which time in āFirst responseā timer run out yesterday (1 day ago)
- āFirst responseā in failInDay(ā-7ā) - find issues which time in āFirst responseā timer run out a week ago(7 days ago)
- āFirst responseā in failInDay(ā7ā) - find issues which time in āFirst responseā timer will run out in a week(in 7 days)
- āfield nameā in searchByStartDate(āconditionā, ādateā) - Search for issues by the date when the timer was first started.
- āfield nameā in searchByPausedDate(āconditionā, ādateā) - Search for issues by the date when the timer was last paused.
- āfield nameā in searchByStopDate(āconditionā, ādateā) - Search for issues by the date when the timer was stopped.
-
āfield nameā in searchByFailDate(āconditionā, ādateā) - Search for issues by the date when the timer was failed.
- date - date in āyyyy-MM-ddā or āyyyy-MM-dd HH:mmā format
- Examples:
- āFirst responseā in searchByStartDate(ā>ā, ā2021-01-01ā) - issues for which timer started after ā2021-01-01ā
- āfield nameā in startInDateRange(ādateā,ādateā) - Search for issues by the date when the timer was started (duration).
- āfield nameā in stopInDateRange(ādateā,ādateā) - Search for issues by the date when the timer was stopped (duration).
-
āfield nameā in failInDateRange(ādateā,ādateā) - Search for issues by the date when the timer was failed (duration).
- Examples:
- āFirst responseā in failInDateRange(ā2020-01-01ā, ā2021-01-01ā) - issues for which the timer has exceeded its time during 2020.
Search by time
- āfield nameā in pauseTime(āconditionā,ātimeā) - Search by pause time in timer and stopwatch fields.
- āfield nameā in realPauseTime(āconditionā,ātimeā) - Search by real pause time in timer and stopwatch fields.
- āfield nameā in timeLeft(āconditionā,ātimeā) - Search by time left in timer fields.
- āfield nameā in timeSpent(āconditionā,ātimeā) - Search by time in timer fields(by total time spent). Time value from index.
-
āfield nameā in realTimeSpent(āconditionā,ātimeā) - Search by real time in timer fields(by total time spent). Time value calculate realtime.
- Examples:
- āFirst responseā in realTimeSpent(ā>ā, ā20mā)
- āFirst responseā in timeLeft(ā<ā, ā20mā)
Other
- āfield nameā in searchByZeroGoalTime() - Search for issues by zero goal time.
- āfield nameā in searchByRestartCount(āconditionā,ānumberā) - Search for issues by the timer count of restart.
- āfield nameā in searchByGoal(ānumberā) - Search issues by timer goal id.
- āfield nameā in searchByCalendar(ānumberā) - Search issues by calendar id.
- āfield nameā in searchByTimerConfig(ānumberā) - Search issues by timer config id.
- āfield nameā in searchByTimerScheme(ānumberā) - Search issues by timer scheme id.