List-Related Functions
Function
Signature
Meaning
Availability
ascending
List ascending(List list)
Returns a new list, that contains the items of the specified list in ascending order.
Codebeamer 9.3.0 and later
avg
Double avg(List list)
Returns the average of all numeric values in the specified list.
Codebeamer 8.2.1 and later
descending
List descending(List list)
Returns a new list, that contains the items of the specified list in descending order.
Codebeamer 9.3.0 and later
dflt
Object dflt(Object... value)
Returns the first of the specified objects, which is not null.
Codebeamer 8.2.1 and later
disjunction
List disjunction(Object... values)
Returns a new list, that contains the disjunction of the specified values. If the values are lists or arrays, the disjunction contains the distinct elements that are not common in all values
Codebeamer 9.3.0 and later
distinct
List distinct(List list)
Returns a list with all not null or distinct or unique values in the specified list.
Codebeamer 8.2.1 and later
first
List first(int x, List items)
Returns a new list, that contains the first x items of the specified list, or the list itself, if it does not contain more than x items.
Codebeamer 9.3.0 and later
intersection
List intersection(Object... values)
Returns a new list, that contains the intersection of the specified values. If the values are lists or arrays, the intersection contains the distinct elements that are common in all values. For example, intersection( members(project, Role("Project Admin")), members(project, Role("Stakeholder")) ) gives users the list of those users and groups, that have the Project Admin and the Stakeholder roles in the current project.
Codebeamer 9.3.0 and later
last
List last(int x, List items)
Returns a new list, that contains the last x items of the specified list, or the list itself, if it does not contain more than x items.
Codebeamer 9.3.0 and later
List
List List(Object...)
Create a list from the passed arguments or the passed array.
max
Object max(List list)
Returns the maximum or largest value in the specified list.
Codebeamer 8.2.1 and later
min
Object min(List list)
Returns the minimum or smallest value in the specified list.
Codebeamer 8.2.1 and later
reverse
List reverse(List list)
Returns a new list, that contains the items of the specified list in reverse order.
codebamber 9.3.0 and later
subtract
List subtract(Object... values)
Returns a new list, that contains the first value, that must be a list or array, minus all other values, that can be individual values or lists or arrays. For example, subtract(assignedTo, members(project, Role("Developer") ) returns the distinct users, groups and roles, that are assigned to the current item, except the users and groups, that are have the Developer in the current project.
Codebeamer 9.3.0 and later
sum
Number sum(List list)
Returns the sum or total of all numeric values in the specified list.
Codebeamer 8.2.1 and later
union
List union(Object... values)
Returns a new list, that contains the union of all distinct values. If values are lists or arrays, then the list/array items are included in the union, not the list/arrays themselves. E.g. union(assignedTo, supervisors) gives users the distinct union of all groups, users and roles, that are either assignedTo or supervisors of the current itemunion( members(project, Role("Project Admin")), User("KlausMehling") ) gives users the distinct union of all users and groups, that have the role with name "Project Admin" in the current project, plus the user with name "KlausMehling".
Codebeamer 9.3.0 and later
For single value attributes, such as status, priority or submitter, users can use valueInList().
For example, to check if the name of the user who has submitted the item is bond or klaus:
valueInList(submitter.name, "bond", "klaus")
For attributes with multiple values (for example, assignedTo, supervisors, subjects, versions, and all custom choice lists), checking for constant values requires valuesInList() in combination with a projection. For example, to check if the issue owner or supervisors list contains any of the specified users by name:
valuesInList(supervisors.{principal|principal.name}, "bond", "klaus")
The objectIdsInList() function is functionally equivalent to:
valuesInList(objects.{object|object.id}, ids)
For example, to check if the resolution field contains a value with ID 2 or 4:
objectIdsInList(resolutions, 2, 4)
or
valuesInList(resolutions.{resolution|resolution.id}, 2, 4)
Was this helpful?