Expression Parser - Jira Workflow Toolbox (Server / DC) 2.x - Decadis Apps Documentation (2023)

FunctionReturned valuetimePart(number t, timeZone time_zone) : numberReturns the time part of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15 this function returns a numeric value representing time 23:15 in milliseconds.datePart(number t, timeZone time_zone) : numberReturns the date part of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15 this function returns a numeric value representing date March, 25th 2011 00:00 in milliseconds.second(number t, timeZone time_zone) : numberReturns the seconds figure of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15:30 this function returns a numeric value representing 30 seconds in milliseconds.minute(number t, timeZone time_zone) : numberReturns the minutes figure of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15:30 this function returns a numeric value representing 15 minutes in milliseconds.hour(number t, timeZone time_zone) : numberReturns the hours figure of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15:30 this function returns a numeric value representing 23 hours in milliseconds.dayOfTheWeek(number t, timeZone time_zone) : numberReturns the day of the week of timestamp represented by numeric value t in time_zone time zone, with Sunday = 1, Monday = 2, ... Saturday = 7.
Example: for timestamp March, 25th 2011 23:15 this function returns 6 for Friday, represented also by macro {FRIDAY} .dayOfTheMonth(number t, timeZone time_zone) : numberReturns the day of the month of timestamp represented by numeric value t in time_zone time zone.
Example: for timestamp March, 25th 2011 23:15 this function returns 25.month(number t, timeZone time_zone) : numberReturns the month of a timestamp represented by numeric value t in a certain time zone, with January = 1, February = 2, ... December = 12.
Example: for timestamp March, 25th 2011 23:15 this function returns 3 for March, represented also by macro {MARCH} .year(number t, timeZone time_zone) : numberReturns the year of a timestamp represented by numeric value t in a certain time zone.
Example: for timestamp March, 25th 2011 23:15 this function returns 2011 .addDays ( number t , number n , timeZone time_zone ) :number
Available since version 2.3.3Returns a timestamp resultant of adding n days to timestamp t . You should use this function instead of simply adding n * {DAY} , since {DAY} is a macro equivalent to 24 * {HOUR} , not taking into account that once in a year we have a day with 25 or 23 hours due to DST transition. Negative values for n are used in order to subtract instead of adding.
Example: addDays(2018/03/27 01:00, -2, LOCAL) returns 2018/03/25 01:00 .addMonths(number t, number n, timeZone time_zone) : numberReturns a timestamp resultant of adding n months to timestamp t. You should use this function instead of simply adding n * {MONTH} , since {MONTH} is a macro equivalent to 30 * {DAY} , not taking into account that some months has more or less than 30 days. Negative values for n are used in order to subtract instead of adding.
Example: for timestamp t with value March, 25th 2011 23:15 calling to addMonths(t, 3, LOCAL) will return a timestamp with value June, 25th 2011 23:15. addYears(number t, number n, timeZone time_zone) : numberReturns a timestamp resultant of adding n years to timestamp t. You should use this function instead of simply adding 12 * {MONTH} or 365 * {DAY} , since that won't take into account that some years have 366 days. Negative values for n are used in order to subtract instead of adding.
Example: for timestamp t with value March, 25th 2011 23:15 calling to addYears(t, 10, LOCAL) will return a timestamp with value March, 25th 2021 23:15. addTimeSkippingWeekends(number t, number timeToBeAdded, timeZone time_zone) : numberAdds timeToBeAdded to t with the difference that weekends don't count in the sum, e.g., if t represents a date-time which coincides with a Saturday, adding timeToBeAdded = 2 * {HOUR} will return a date-time for next Monday at 02:00 . Use negative values at timeToBeAdded for subtracting time from t.addTimeSkippingWeekends(number t, number timeToBeAdded, timeZone time_zone, number beginning_of_weekend, number end_of_weekend) : number
Available since version 2.2.7Same as previous function, but with a custom defined weekend. Arguments beginning_of_weekend and end_of_weekend take values {MONDAY} , {TUESDAY} ... {SUNDAY} .
Example of usage for adding 12 hours to Current date and time using Israeli weekend: addTimeSkippingWeekends({00057}, 12 * {HOUR}, LOCAL, {FRIDAY}, {SATURDAY}) , being {00057} field code for Current date and time.addDaysSkippingWeekends(number t, number n, timeZone time_zone) : number

Returns a timestamp equivalent of t + n*{DAY} with the difference that weekends don't count in the sum, e.g., if t represents a timestamp which coincides with a Friday, adding n = 1 will return a date-time for next Monday. Negative values for n are used in order to subtract days to t.

Note:ncannot be higher than 50000.

Example: Set "Due date" 6 natural days (or work days) earlier than a "Date Picker" custom field

addDaysSkippingWeekends(number t, number n, timeZone time_zone, number beginning_of_weekend, number end_of_weekend) : number
Available since version 2.2.7

Same as previous function, but with a custom defined weekend. Arguments beginning_of_weekend and end_of_weekend take values {MONDAY}, {TUESDAY} ... {SUNDAY} .

Note:ncannot be higher than 50000.

Example of usage for adding 10 workdays to Due date using Israeli weekend: addDaysSkippingWeekends({00012}, 10, LOCAL, {FRIDAY}, {SATURDAY}) , being {00012} field code for Due date.

subtractDatesSkippingWeekends(number minuend_date, number subtrahend_date, timeZone time_zone) : numberReturns a timestamp equivalent "minuend_date - subtrahend_date" subtracting weekend periods from the result, i.e., you get the elapsed working time from subtrahend_date to minuend_date.subtractDatesSkippingWeekends(number minuend_date, number subtrahend_date, timeZone time_zone, number beginning_of_weekend, number end_of_weekend) : number
Available since version 2.2.7Same as previous function, but with a custom defined weekend. Arguments beginning_of_weekend and end_of_weekend take values {MONDAY}, {TUESDAY} ... {SUNDAY} .
Example of usage calculating the worktime from Creation to Resolution using Israeli weekend: subtractDatesSkippingWeekends({00112}, {00009}, LOCAL, {FRIDAY}, {SATURDAY}) , being {00112} field code for Resolution date and time, and {00009} field code for Creation date and time.dateToString(number t, timeZone time_zone, language) : stringReturns a string representing the date-time value at t, in a certain time zone, and in a certain language. This function is useful in post-function Copy parsed text to a field to represent as a string the result of a time expression.

dateTime(number year, numbermonth, numberdayOfMonth, numberhourOfDay, numberminute, timeZonetime_zone) : number

Available since version 2.3.3

This function is used for obtaining a date-time literal value from a set of numeric values representing a date-time timestamp.
Example:dateTime(2018, 03, 25, 23, 15, LOCAL)returns2018/03/25 23:15.dateTimeToString(number t, timeZone time_zone, language) : stringReturns a string representing the date-time value at t, in a certain time zone, and in a certain language. This function is useful in post-function Copy parsed text to a field to represent as a string the result of a time expression.dateTimeToString(number t, string date_time_pattern , language) : string
Available since version 2.1.33Returns a string representing the date-time value at t with a certain custom format defined by date_time_pattern string parameter, using a certain language when using words for months, days of the week, etc. This function is useful in post-function Copy parsed text to a field to represent as a string the result of a time expression.
Example: dateTimeToString(2011-03-25 11:30, "yyyy.MM.dd 'at' HH:mm:ss", USER_LANG) returns string "2011.03.25 at 11:30:00".dateTimeToString(number t, string date_time_pattern , timeZone time_zone, language) : string
Available since version 2.4.0

Returns a string representing the date-time value at t with a certain custom format defined by date_time_pattern string parameter, in a certain timezone time_zone, using a certain language when using words for months, days of the week, etc. This function is useful in post-function Copy parsed text to a field to represent as a string the result of a time expression.

Example: dateTimeToString(0, "yyyy.MM.dd 'at' HH:mm:ss", GMT, USER_LANG) returns string "1970.01.01 at 00:00:00".

Example: dateTimeToString(0, "yyyy.MM.dd 'at' HH:mm:ss", MST, USER_LANG) returns string "1969.12.31 at 17:00:00".

daysInTheMonth(numbert, timeZonetime_zone) : number

Available since version 2.3.3

Returns the number of days in the month of timestamptin timezonetime_zone.
Example:daysInTheMonth(2016/02/28 00:00, LOCAL)returns29, taking into account that 2016 is a leap year.monthToString(number t, timeZone time_zone, language) : stringReturns a string with the name of the month for a date-time t, in a certain time zone, and in a certain language. This function can be used in post-function Copy parsed text to a field to write the name of the month of a date-time field or expression.dayOfTheWeekToString(number t, timeZone time_zone, language) : stringReturns a string with the day of the week for a date-time t, in a certain time zone, and in a certain language. This function is useful in post-function Copy parsed text to a field to write the day of the week of a date-time field or expression.stringToDate(string s, timeZone time_zone) : number
Available since version 2.1.26Returns a numeric value with the date-time represented by string s. The numeric value returned corresponds to the milliseconds elapsed since January 1, 1970, 00:00:00 GMT. Valid input string formats are yyyy/MM/dd HH:mm, yyyy-MM-dd HH:mm, yyyy/MM/dd, yyyy-MM-dd, also formats relative to current time like in JQL queries: "w" (weeks), "d" (days), "h" (hours) or "m" (minutes), or format defined at system property jira.date.time.picker.java.format.

Example: Validation based on a Date type Project Property

stringToDate(string s, string date_time_pattern ) : number
Available since version 2.1.33

Returns a numeric value with the date-time represented by string s. Expected format of value at parameter "s" is defined by date_time_pattern string parameter. The numeric value returned corresponds to the milliseconds elapsed since January 1, 1970, 00:00:00 GMT.

Example: stringToDate("2011.03.25 at 11:30:00", "yyyy.MM.dd 'at' HH:mm:ss") returns a date-time numeric value that can be used for setting a Date Time picker custom field.

stringToDate(string s, string date_time_pattern , string language , string country ) : number
Available since version 2.2.29

Returns a numeric value with the date-time represented by string s. Expected format of value at parameter "s" is defined by date_time_pattern string parameter for a specific language (language code ISO 639-2 ) and country (country code ISO 3166 alpha-2 ). The numeric value returned corresponds to the milliseconds elapsed since January 1, 1970, 00:00:00 GMT.

Example: stringToDate("Dec 7, 2016 2:10:25 AM PST", "MMM d, yyyy h:mm:ss a z", "eng", "US") returns a date-time numeric value that can be used for setting a Date Time picker custom field.

timeInValue(string field field, boolean expression predicate) : number

Available since version 2.6.0

Returns the number of milliseconds a string field with code%{nnnnn}of the current issue has had a value satisfying a boolean expressionpredicate, where the string value of the field with code%{nnnnn}is represented by^%.

Example:timeInValue(%{00000}, ^% ~~ "ERROR" OR ^% ~~ "WARNING")returns the number of milliseconds the fieldsummary(field code%{00000}) of the current issue has contained any of the words "ERROR" or "WARNING", ignoring the case.

Example:timeInValue(%{00094}, count(toStringList(^%, ",")) > 1)returns the number of milliseconds the fieldcomponents(field code%{00094}) of the current issue has contained more than one selected component.

Example:timeInValue(%{00017}, ^% in ["Critical", "High"])returns the number of milliseconds the field priority (field code%{00017}) of the current issue has had a value ofCriticalorHigh.

timeInValue(number field field, boolean expression predicate) :number

Available since version 2.6.0

Returns the number of milliseconds a number or date-time field with code{nnnnn}of the current issuehas had a value satisfying a boolean expressionpredicate, where the numeric value of the field with code{nnnnn}is represented by^.

Example:timeInValue({00012}, ^ != null)returns the number of milliseconds the fieldDue date(field code{00012})of the current issue has had a value.

Example:timeInValue({10001}, ^ >= 5 AND ^ <= 10)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) of the current issue has remained between 5 and 10.

Example:timeInValue({10001}, modulus(^, 2) = 0)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001})of the current issue has had an even value (2, 4, 6,...).

timeInValue(string field field,issue listissues, boolean expression predicate) :number

Available since version 2.6.0

Returns the sum of milliseconds a string field with code%{nnnnn}has had a value satisfying a boolean expressionpredicate in distinct issues, where the string value of the field with code%{nnnnn}is represented by^%.

Example:timeInValue(%{00000}, subtasks(), ^% ~~ "ERROR" OR ^% ~~ "WARNING")returns the sum of milliseconds the fieldsummary(field code%{00000}) of all sub-tasks of the current issue have contained any of the words "ERROR" or "WARNING", ignoring the case.

Example:timeInValue(%{00094}, epic(), count(toStringList(^%, ",")) > 1)returns the number of milliseconds the field components(field code%{00094}) in a linkedEpic issue have contained more than one selected component.

Example:timeInValue(%{00017}, filterByIssueType(linkedIssues(), "Bug, New Feature"), ^% in ["Critical", "High"])returns the sum of milliseconds all linkedBugsandNew Featuresof the current issue havehad a priority (field code%{00017}) value ofCriticalorHigh.

timeInValue(number field field,issue listissues, boolean expression predicate) :number

Available since version 2.6.0

Returns the sum of milliseconds a number or date-time field with code{nnnnn}has had a value satisfying a boolean expressionpredicate in distinct issues, where the numeric value of the field with code{nnnnn}is represented by^.

Example:timeInValue({00012}, subtasks(), ^ != null)returns the number of milliseconds the fieldDue Date(field code{00012}) of all sub-tasks of the current issue has had a value.

Example:timeInValue({10001}, epic(), ^ >= 5 AND ^ <= 10)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) of an Epic issue hashad a value between 5 and 10.

Example:timeInValue({10001}, filterByIssueType(linkedIssues(), "Bug, New Feature"), modulus(^, 2) = 0)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) has had an even value in any linkedBugorNew Feature.

timeInValue(string field field, boolean expression predicate,string schedule_name,timeZone time_zone) : number

Available since version 2.6.0

Returns the number of milliseconds a string field with code%{nnnnn}of the current issuehas had a value satisfying a boolean expressionpredicate, where the string value of the field with code%{nnnnn}is represented by^%. The time being calculated by this function is only counted during a defined schedule with nameschedule_namefortimeZone time_zone.

Example:timeInValue(%{00000}, ^% ~~ "ERROR" OR ^% ~~ "WARNING", "my_schedule", LOCAL)returns the number of milliseconds the fieldsummary(field code%{00000}) of the current issue has contained any of the words "ERROR" or "WARNING", ignoring the case, within a schedule namedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue(%{00094}, count(toStringList(^%, ",")) > 1, "my_schedule", LOCAL)returns the number of milliseconds the fieldcomponents(field code%{00094}) of the current issue has contained more than one selected component, within a schedulenamedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue(%{00017}, ^% in ["Critical", "High"], "my_schedule", LOCAL)returns the number of milliseconds the current issue has had a priorityvalue ofCriticalorHigh(field code%{00017}), within a schedulenamedmy_schedulefor the server's defaulttime_zone.

timeInValue(number field field, boolean expression predicate, stringschedule_name,timeZonetime_zone) :number

Available since version 2.6.0

Returns the number of milliseconds of a number or date-time field with code{nnnnn}of the current issue has had a values satisfying a boolean expressionpredicate, where the numeric value of the field with code{nnnnn}is represented by^. The time being calculated by this function is only counted during a defined schedule with nameschedule_namefortimeZone time_zone.

Example:timeInValue({00012}, ^ != null, "my_schedule", LOCAL)returns the number of milliseconds the field Due Date (field code{00012}) of the current issue has had a value,ignoring the case, within a schedule namedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue({10001}, ^ >= 5 AND ^ <= 10, "my_schedule", LOCAL)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) of the current issue has had a value between 5 and 10, within a schedule namedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue({10001}, modulus(^, 2) = 0, "my_schedule", LOCAL)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) in current issue has had an even value, within a schedule namedmy_schedulefor the server's defaulttime_zone.

timeInValue(string field field,issue listissues, boolean expression predicate,stringschedule_name,timeZonetime_zone) :number

Available since version 2.6.0

Returns the sum of milliseconds a string field with code%{nnnnn}has had a value satisfying a boolean expressionpredicate in distinct issues, where the value of the field with code%{nnnnn}is represented by^%.The time being calculated by this function is only counted during a defined schedule with nameschedule_namefortimeZone time_zone.

Example:timeInValue(%{00000}, subtasks(), ^% ~~ "ERROR" OR ^% ~~ "WARNING", "my_schedule", LOCAL)returns the sum of milliseconds the fieldssummary(field code%{00000})of all sub-tasks of the current issue have contained any of the words "ERROR" or "WARNING", ignoring the case, within a schedulenamedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue(%{00094}, epic(), count(toStringList(^%, ",")) > 1, "my_schedule", LOCAL)returns the number of milliseconds the fieldcomponents(field code%{00094}) in the linked Epic issue has contained more than one selected component,within a schedulenamedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue(%{00017}, filterByIssueType(linkedIssues(), "Bug, New Feature"), ^% in ["Critical", "High"], "my_schedule", LOCAL)returns the sum of milliseconds all linkedBugsandNew Featuresof the current issue havehad a priority (field code%{00017}) value ofCriticalorHigh,within a schedulenamedmy_schedulefor the server's defaulttime_zone.

timeInValue(number field field,issue listissues, boolean expression predicate,stringschedule_name,timeZonetime_zone) :number

Available since version 2.6.0

Returns the sum of milliseconds number or date-time field with code{nnnnn}has had a value satisfying a boolean expressionpredicate in distinct issues, where the numeric value of the field with code{nnnnn}is represented by^.The time being calculated by this function is only counted during a defined schedule with nameschedule_namefortimeZone time_zone.

Example:timeInValue({00012}, subtasks(), ^ != null, "my_schedule", LOCAL)returns the number of milliseconds the fieldDue date(field code{00012}) of all sub-tasks of the current issue have had a value,within a schedulenamedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue({10001}, epic(), ^ >= 5 AND ^ <= 10, "my_schedule", LOCAL)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) inthe linked Epic issue has had a value between 5 and 10,within a schedulenamedmy_schedulefor the server's defaulttime_zone.

Example:timeInValue({10001}, filterByIssueType(linkedIssues(), "Bug, New Feature"), modulus(^, 2) = 0, "my_schedule", LOCAL)returns the number of milliseconds a hypothetical numeric field calledPassengers(field code{10001}) has had an even value in any linkedBugorNew Feature,within a schedulenamedmy_schedulefor the server's defaulttime_zone.

timeLogged(issue listissues) : number

Available since version 2.3.3

Returns the sum of all the time logged inissuesin milliseconds.
Example:timeLogged(subtasks())returns the sum of time logged in current issue's sub-tasks in milliseconds.

timeLogged(issue listissues, numberdatetime_ini, numberdatetime_end) : number

Available since version 2.3.3

Returns the sum of all the time logged inissuesin time interval defined by timestampsdatetime_inianddatetime_end. If one or both parametersdatetime_inianddatetime_endarenull, then it's assumed that the time period hasn't low or high time limit respectively. Logged time is returned in milliseconds.
Example:timeLogged(issuesUnderEpic(), datePart({00057}, LOCAL), addDays(datePart({00057}, LOCAL), 1, LOCAL))returns the sum of time logged today in issues under current issue's Epic. Note that{00057}is field code forCurrent date and time.

timeLogged(issue listissues, stringuser) : number

Available since version 2.3.3

Returns all the time logged in issues by user with usernameuser. Logged time is returned in milliseconds. Argumentusercan contain a single user name (not be confused with user's full name), or a comma separated list of usernames, group names or project role names.
Example:timeLogged(linkedIssues(), %{00003})returns the sum of time logged by the assignee on linked issues. Note that%{00003}is field code forAssignee.

timeLogged(issue listissues, numberdatetime_ini, numberdatetime_end, stringuser) : number

Available since version 2.3.3

Returns the sum of all the time logged in issues byuserin time interval defined by timestampsdatetime_inianddatetime_end. If one or both parametersdatetime_inianddatetime_endarenull, then it's assumed that the time interval hasn't low or high time limit respectively. Logged time is returned in milliseconds. Argumentusercan contain a single username (not be confused with user's full name), or a comma separated list of usernames, group names or project role names.
Example:timeLogged(subtasks(), 2018/01/01, 2019/01/01, %{00003})returns the sum of time logged by the assignee on subtasks during 2018. Note that%{00003}is field code forAssignee.formatDuration(number duration) : string
Available since version 2.2.30

Returns a string with the pretty representation of a time duration, i.e. a subtraction of 2 date-time values, using the language of current user's profile.

Example: formatDuration(2017-01-31 11:30 - 2017-01-30 00:00) returns "1 day, 11 hours, 30 minutes" .

lastDayOfTheMonth(numbert, timeZonetime_zone) : number

Available since version 2.3.3

Returns the timestamp for the last day of the month of timestamptin timezonetime_zone. The timestamp returned is at00:00, i.e., just the beginning of the day.
Example:lastDayOfTheMonth(2017/02/05 11:31, LOCAL)returns2017/02/28 00:00.

nextDayOfTheWeek(numbert,numberdayOfWeek,timeZonetime_zone) :number

Available since version 2.3.3

Returns the timestamp for the next day of the week represented bydayOfWeeksince timestamptin timezonetime_zone. The timestamp returned is at00:00, i.e., just the beginning of the day.
Example:nextDayOfTheWeek(2018/03/01 12:31, {SUNDAY}, LOCAL)returns2018/03/04 00:00, taking into account that 2018/03/01 is Thursday.
Example:nextDayOfTheWeek(2018/03/01 12:31, {THURSDAY}, LOCAL)returns2018/03/08 00:00.

weekOfTheYear(number t, number firstDayOfTheWeek, numberminimalDaysInFirstWeek, timeZone time_zone): number

Available since version: 2.6.0

Returns theweek of the yearof the date-timetin a certaintime_zone. The parameterfirstDayOfTheWeekrepresents the first day of the week, e.g.:{SUNDAY}in the U.S., and{MONDAY}in Germany. The parameterminimalDaysInFirstWeekrepresents the minimal number of days required in the first week of the year, e.g., if the first week is defined as the one that contains the first day of the first month of the year, value1should be used. If the minimal number of days required must be a full week (e.g. all days of the week need to be in that year), value7should be used.

Examples:

  • weekOfTheYear(2023/01/03, {SUNDAY}, 1, LOCAL) returns1
  • weekOfTheYear(2023/01/03, {MONDAY}, 1, LOCAL) returns2
  • weekOfTheYear(2023/01/03, {MONDAY}, 7, LOCAL) returns 1
  • Europe:weekOfTheYear(2023/01/04, {MONDAY}, 4, LOCAL)
  • America (South and North), Southern Africa:weekOfTheYear(2023/01/04, {SUNDAY}, 1, LOCAL)
  • Australia, New Zealand:weekOfTheYear(2023/01/04, {MONDAY}, 1, LOCAL)
  • Algeria:weekOfTheYear(2023/01/04, {SATURDAY}, 1, LOCAL)

More info:https://www.epochconverter.com/weeknumbers

dayOfTheYear(number t, timeZone time_zone): number

Available since version: 2.6.0

Returns theday of the yearof date-timetin a certaintime_zone, e.g.for January 1st the value returned will be1.

Example:dayOfTheYear(2019/02/01, LOCAL)returns32

shortFormatDuration(number duration) : string
Available since version 2.2.30

Returns a string with the most compact representation possible of a time duration, i.e. a subtraction of 2 date-time values, using the language of current user's profile.

Example: shortFormatDuration(2017-01-31 11:30 - 2017-01-30 00:00) returns "1d 11h 30m" .

formatWorkDuration(number duration) : string
Available since version 2.2.34

Similar to function formatDuration() but using the workday and workweek defined at time tracking configuration , instead of 24 hours per day and 7 days per week.

Example: formatWorkDuration(5 * 8 * {HOUR} + 2 * 8 * {HOUR} + 3 * {HOUR}) returns "1 week, 2 days, 3 hours", with 8 hours per workday and 5 days per workweek.

shortFormatWorkDuration(number duration) : string
Available since version 2.2.34

Similar to function shortFormatDuration() but using the workday and workweek defined at time tracking configuration , instead of 24 hours per day and 7 days per week.

Example: formatWorkDuration(5 * 8 * {HOUR} + 2 * 8 * {HOUR} + 3 * {HOUR}) returns "1w 2d 3h" , with 8 hours per workday and 5 days per workweek.

timeZone(string timeZone_name) : timeZone
Available since version 2.2.39

Returns the timeZone whose name is represented by string timeZone_name. This function is useful to obtain a timeZone from a string, like the value of a Project Properties.

Example: timeZone("DST") returns DST timeZone.

timeInStatus(stringstatus_name) : number
Available since version 2.4.4

Returns the number ofmillisecondsthe current issue has remained in a status with namestatus_name. If an issue has been in that status more than once, thenduration will be summed upand the total time spent in the status will be returned.

Example:timeInStatus("Open")returns the number of milliseconds the current issue has stayed in status"Open".

In order to display this value in a more readable way, the milliseconds should be transformed into a more readable unit, like in the following example:

timeInStatus("Open") / {DAY} - for number of days, ortimeInStatus("Open") / {HOUR} - for number of hours.

timeInStatus(stringstatus_name, stringschedule_name, timeZonetime_zone) : number
Available since version 2.4.4

Returns the number ofmillisecondsthe current issue has remained in a status with namestatus_namewithin a schedule namedschedule_namefor a giventime_zonetimeZone.If an issue has been in that status more than once, thenduration will be summed upand the total time spent in the status will be returned.

Example:timeInStatus("Open", "my_schedule", LOCAL)returns the number of milliseconds the current issue has stayed in status"Open"within the schedule called"my_schedule"matching theserver's default timeZone.

timeInStatus(stringstatus_name, issue listissues) : number
Available since version 2.4.4

Returns the sum of milliseconds issues in an issue listissueshave remained in a status with namestatus_name. If an issue from that listhas been in that status more than once, thenduration will be summed upand the total time spent in the status will be returned.

Example:timeInStatus("Open", subtasks())returns the number of milliseconds the current issue's sub-tasks have stayed in status"Open".

timeInStatus(stringstatus_name, issue listissues, stringschedule_name, timeZonetime_zone) : number
Available since version 2.4.4

Returns the sum of milliseconds issues in an issue listissueshave remained in a status with namestatus_namewithin a schedule namedschedule_namefor a giventime_zonetimeZone.If an issue from that listhas been in that status more than once, thenduration will be summed upand the total time spent in the status will be returned.

Example:timeInStatus("Open", subtasks(), "my_schedule", LOCAL)returns the number of milliseconds the current issue's sub-tasks have stayed in status"Open"within the schedule called"my_schedule"matching theserver's default timeZone.

fieldChangeTimes(string field field, boolean expression predicate) :number list

Available since version 2.6.0

Returns the timestamps of when a string value of field with code%{nnnnn}has changed satisfying a certainpredicatethat depends on the values of the field before and after the value change. The string value before the change is represented by^0%, and after the change by^1%. The timestamps are returned as a number list sorted in ascending order.

Example:fieldChangeTimes(%{00000}, ^0% !~~ "IMPORTANT" AND ^1% ~~ "IMPORTANT")returns the list of timestamps when the word"IMPORTANT"has been added to the current issue's summary (field code%{00000}) ignoring the case.

Example:fieldChangeTimes(%{00017}, ^0% = null AND ^1% != null)returns the list of timestamps of when the issue'spriority (field code%{00017}) of the current issue has been set.

Example:fieldChangeTimes(%{00017}, ^0% not in ["Critical", "High"] AND ^1% in ["Critical", "High"])returns the list of timestamps when current issue's priority (field code%{00017}) has becomeCriticalorHigh.

fieldChangeTimes(number field field,boolean expressionpredicate) :number list

Available since version 2.6.0

Returns the timestamps of when a numeric / date-time value of field with code{nnnnn}has changed satisfying a certainpredicatethat depends on the values of the field before and after the value change. The numeric value before the change is represented by^0, and after the change by^1. The timestamps are returned as a number list sorted in ascending order.

Example:fieldChangeTimes({00012}, ^0 < ^1)returns the timestamps of when theDue date(field code{00012}) has been edited to a higher value.

Example:fieldChangeTimes({10001}, abs(^0 - ^1) / ^0 >= 0.25)returns the timestamps of when a hypothetical numeric field calledPassengers(field code{10001}) has been edited with a variation of at least 25% over its previous value.

fieldChangeTimes(string field field, issue listissues, boolean expression predicate) : number list

Available since version 2.6.0

Returns the timestamps of when a string value of fields with code %{nnnnn} in distinct parameterissueshave changed satisfying certainpredicatethat depends on the values of the fields before and after the value change. The string value before the change is represented by^0%, and after the change by^1%. The timestamps are returned as a number list containing a sequence of sorted numeric values in ascending order for each parameterissue.

Example:fieldChangeTimes(%{00000}, subtasks(), ^0% !~~ "IMPORTANT" AND ^1% ~~ "IMPORTANT")returns the list of timestamps of when the word"IMPORTANT"has been added the the summary (field code%{00000}) of all current issue's sub-tasks, ignoring the case.

Example:fieldChangeTimes(%{00017}, epic(), ^0% = null AND ^1% != null)returns the list of timestampsof when the issue priority (field code%{00017}) of the current issue's epic has been set.

Example:fieldChangeTimes(%{00017}, linkedIssues("is blocked by"), ^0% not in ["Critical", "High"] AND ^1% in ["Critical", "High"])returns the list of timestampsof when the priority (field code%{00017}) in all blocking linked issues has becomeCriticalorHigh.

fieldChangeTimes(number field field,issue listissues, boolean expression predicate) : number list

Available since version 2.6.0

Returns the timestampsof when a numeric value of fields with code {nnnnn} in distinct parameterissueshave changed satisfying a certainpredicatethat depends on the values of the fields before and after the value change. The numeric value before the change is represented by^0, and after the change by^1. The timestamps are returned as a number list containing a sequence of sorted numeric values in ascending order for each parameterissue.

Example:fieldChangeTimes({00012}, subtasks(), ^0 < ^1)returns the timestampsof when the Due Date(field code{00012}) has been edited to a higher value in any of the current issue's sub-tasks.

Example:fieldChangeTimes({10001}, epic(), abs(^0 - ^1) / ^0 >= 0.25)returns the timestamps when a hypothetical numeric field calledPassengers(field code{10001}) in the current issue's epic has been edited with a variation of at least 25% over its previous value

lastFieldChangeTime(string field field) :number

Available since version 2.6.0

Returns the timestamp of most recent value update of a field with code%{00000}.

Example:lastFieldChangeTime(%{00000})returns the timestamp of the last update of an issue's summary(field code{00000}).

References

Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated: 21/08/2023

Views: 6396

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.