Overview
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).
Fixed values
A number list can also be written in literal form using the following format: [number, number, ...].
Example
[1, -2, 3, 3.14, 2.71]
Number list functions
The following functions are intended to build expressions that return number lists or numbers.
Function | Input | Returned value |
---|---|---|
filterByCardinality(number list l, comparison operator operator, number n) | 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: |
filterByValue(number list l, comparison operator operator, number n) | NUMBER [] NUMBER | Returns a NUMBER [] l satisfying the comparison number_in_list operator n. |
filterByPredicate(number list l, boolean expression predicate) | NUMBER [] BOOLEAN | Returns a NUMBER [] l that validates a predicate. Argument predicate is a boolean expression, where |
append(number list l, number list m) | 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. |
union(number list l, number list m) | NUMBER [] | Returns a NUMBER [] with all numbers in argument l or in argument m without duplicated numbers. |
except(number list l, number list m) | 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. |
intersect(number list l, number list m) | NUMBER [] | Returns a NUMBER [] with all numbers in argument l and m simultaneously. |
distinct(number list l) | NUMBER [] | Returns a NUMBER [] with all numbers in list l without any duplication. |
count(number list l) | NUMBER [] | Returns the NUMBER of numeric values in l. |
count(number n, number list l) | NUMBER NUMBER [] | Returns the NUMBER of times n appears in l. |
sum(number list l) | NUMBER [] | Returns the sum of NUMBER values in l. |
avg(number list l) | NUMBER [] | Returns the arithmetic mean of NUMBER values in l. |
max(number list l) | NUMBER [] | Returns the maximum NUMBER value in l. |
min(number list l) | NUMBER [] | Returns the minimum nuNUMBER value in l. |
first(number list l) | NUMBER [] | Returns NUMBER of the first element in number list l, or |
last(number list l) | NUMBER [] | Returns NUMBER of the first element in number list l, or null if l is an empty list. |
nthElement(number list l, number n) : number | NUMBER [] NUMBER | Returns NUMBER element at position n in number list l, where n >= 1 and n <= count(l). Returns |
getMatchingValue(string key, string list key_list, number list value_list) 0 | 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 |
getMatchingValue(string key, string list key_list, number list value_list) | 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 |
sublist(number list l, number indexFrom, number indexTo) | 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. |
indexOf(number element, number list l) : number | NUMBER NUMBER [] | Returns the index of NUMBER value element in number list l. Zero is returned when element is not found in l. |
sort(number list l, order) | NUMBER [] | Returns a NUMBER []with elements in l sorted in specified order. Available orders are ASC (for ascending order) and DESC (for descending order). |
textOnNumberList(number list numbers, string text_expression) | 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 |
mathOnNumberList(number list numbers, number math_time_expression) | 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 |