The Number list data type is an ordered list of numbers. This data type is returned, among others, by functions that return values of number fields in a selection of issues (linked issues, sub-tasks, and subsets). A number list can also be written in literal form using the following format: [number, number, ...]. Example The following functions are intended to build expressions that return number lists or numbers. NUMBER [] NUMBER Returns a NUMBER [] l whose cardinality (i.e., the number of times it appears in list l) satisfies the comparison cardinality operator n. Available comparison operators: NUMBER [] NUMBER Returns a NUMBER [] l satisfying the comparison number_in_list operator n. NUMBER [] BOOLEAN Returns a NUMBER [] l that validates a predicate. Argument predicate is a boolean expression, where ^ is used for referencing numeric values in argument l. NUMBER [] Returns a NUMBER [] with all numbers in arguments l and m. Duplicated numbers may appear in output. Use function union(l, m) instead, if you want to avoid repetitions. NUMBER [] Returns a NUMBER [] with all numbers in argument l or in argument m without duplicated numbers. NUMBER [] Returns a NUMBER []with all numbers in argument l which are not in argument m. Duplicated numbers in l may appear in output. Use function distinct() to remove them if you need to. NUMBER [] Returns a NUMBER [] with all numbers in argument l and m simultaneously. NUMBER [] Returns a NUMBER [] with all numbers in list l without any duplication. NUMBER [] Returns the NUMBER of numeric values in l. NUMBER NUMBER [] Returns the NUMBER of times n appears in l. NUMBER [] Returns the sum of NUMBER values in l. NUMBER [] Returns the arithmetic mean of NUMBER values in l. NUMBER [] Returns the maximum NUMBER value in l. NUMBER [] Returns the minimum NUMBER value in l. NUMBER [] Returns NUMBER of the first element in number list l, or null if l is an empty list. NUMBER [] Returns NUMBER of the first element in number list l, or null if l is an empty list. NUMBER [] NUMBER Returns NUMBER element at position n in number list l, where n >= 1 and n <= count(l). Returns null if n is greater than the number of elements in l. STRING NUMBER [] STRING [] Returns NUMBER in value_list that is in the same position as string key is in key_list, or in case key doesn't exist in key_list and value_list has more elements than key_list, the element of value_list in position NUMBER [] STRING [] Returns NUMBER value in value_list that is in the same position as numeric key is in key_list, or in case key doesn't exist in key_list and value_list has more elements than key_list, the element of value_list in position NUMBER [] Returns a NUMBER [] with elements in l from indexFrom index to indexTo index. Having indexFrom >= 1 and indexFrom <= count(l) and indexTo >= 1 and indexTo <= count(l) and indexFrom <= indexTo. NUMBER NUMBER [] Returns the index of NUMBER value element in number list l. Zero is returned when element is not found in l. NUMBER [] Returns a NUMBER []with elements in l sorted in specified order. Available orders are ASC (for ascending order) and DESC (for descending order). NUMBER [] STRING Returns a STRING [] resulting of evaluating text_expression against each of the numeric values in argument numbers. Argument text_expression is an expression that returns a string, where ^ represents each numeric value in argument numbers. NUMBER [] Returns a NUMBER [] resulting of evaluating math_time_expression against each of the numeric values in argument numbers. Argument math_time_expression is a math/time expression, where ^ represents each numeric value in argument numbers. Overview
Fixed values
[1, -2, 3, 3.14, 2.71]
Number list functions
Function Input Returned value filterByCardinality(number list l, comparison operator operator, number n) =, !=, <, <=, >
and >=
.
Example: filterByCardinality([1, 1, 2, 3, 4, 4, 4, 5], >, 1)
returns the following number list: [1, 4] . filterByValue(number list l, comparison operator operator, number n)
Example: filterByValue([1, 2, 3, 10, 11, 25, 100], >, 10)
returns the list of numbers greater than 10. i.e., [11, 25, 100] filterByPredicate(number list l, boolean expression predicate)
Example: filterByPredicate([1, 2, 3, 4], ^ > 2)
returns values greater than 2, i.e., [3, 4] .
Example: filterByPredicate([1, 2, 3, 4], remainder(^, 2) = 0)
returns even values, i.e., [2, 4] . append(number list l, number list m)
Example: append([1, 2, 3], [3, 4, 5])
returns [1, 2, 3, 3, 4, 5] .
Example: append(fieldValue({00025}, linkedIssues("is blocked by")), fieldValue({00025}, subtasks()))
returns a list of numbers with Total Time Spent (in minutes) in blocking issues and sub-tasks. This number list can be summed using function sum(). union(number list l, number list m)
Example: union([1, 2, 3], [3, 4, 5])
returns [1, 2, 3, 4, 5] . except(number list l, number list m)
Example: except([1, 2, 3, 4, 5], [2, 4])
returns [1, 3, 5]. intersect(number list l, number list m)
Example: intersect([1, 2, 3, 4, 5], [9, 7, 5, 3, 1])
returns [1, 3, 5] . distinct(number list l)
Example: distinct([1, 2, 1, 3, 4, 4, 5])
returns [1, 2, 3, 4, 5] .
Example: distinct(fieldValue({...duedate}, linkedIssues("is cloned by")))
returns a list of dates containing due dates of cloning issues, with only one occurrence per due date, although more than one issue may share the same due date. count(number list l)
Example: count([1, 1, 2, 2])
returns 4 .
Example: count(subtasks()) - count(fieldValue({...duedate}, subtasks()))
returns the number of sub-tasks with field "Due Date" unset. count(number n, number list l)
Example: count(1, [1, 1, 2, 2, 1, 0])
returns 3 . sum(number list l)
Example: sum([1, 2, 3, 4, 5])
returns 15.
Example: sum(fieldValue({00025}, subtasks()))
returns the total time spent in minutes in all sub-tasks of current issue. avg(number list l)
Example: avg([1, 2, 3, 4, 5])
returns 3.
Example: avg(fieldValue({00024}, linkedIssues("is blocked by")))
returns the mean of remaining times in minutes among blocking issues. max(number list l)
Example: max([1, 2, 5, 4, 3])
returns 5.
Example: max(fieldValue({00024}, linkedIssues("is blocked by")))
returns the maximum remaining times in minutes among blocking issues. min(number list l)
Example: min([2, 1, 5, 4, 3])
returns 1.
Example: min(fieldValue({00024}, linkedIssues("is blocked by")))
returns the minimum remaining times in minutes among blocking issues. first(number list l)
Example: first([3, 2, 1, 0])
returns 3. last(number list l)
Example: last([3, 2, 1, 0])
returns 0. nthElement(number list l, number n)
Example: nthElement([5, 6, 7, 8], 3)
returns 7. getMatchingValue(string key, string list key_list, number list value_list) count(key_list) + 1
.
Example: getMatchingValue("Three", ["One", "Two", "Three", "Four", "Five"], [1, 1+1, 3*1, 4, 4+1])
returns 3. getMatchingValue(string key, string list key_list, number list value_list) count(key_list) + 1
.
Example: getMatchingValue(5, [1, 3, 5, 7, 9], [1, 1+1, 3*1, 4, 4+1])
returns 3. sublist(number list l, number indexFrom, number indexTo)
Example: sublist([1, 2, 3, 4, 5], 2, 4)
returns [2, 3, 4]. indexOf(number element, number list l)
Example: indexOf(1, [5, 2, 1, 4, 1])
returns 3. sort(number list l, order)
Example: sort([2, 4, 3, 1], ASC)
returns [1, 2, 3, 4]. textOnNumberList(number list numbers, string text_expression)
Example: textOnNumberList([1, 2, 3, 4, 5], substring("smile", 0, ^))
returns string list ["s", "sm", "smi", "smil", "smile"]. mathOnNumberList(number list numbers, number math_time_expression)
Example: mathOnNumberList([1, 2, 3, 4, 5], ^ * 2)
returns number list [2, 4, 6, 8, 10].
🚀 Effective since April 2020 and JWT version 2.9.0 Automation Toolbox for Jira is fully integrated into our top rated app Jira Workflow Toolbox (JWT). 🚀