Supported list types


Number list

This function filters a number list by the list elements' cardinality (how often they appear in the list) using the given comparison.


filterByCardinality(numberList, operator, number) #Output: Number list



Parser expressionDescription


%{filterByCardinality([anyNumberList], >, 1)}


In this example a number list with those elements would be returned, that occurred more than once in the number list.


%{filterByCardinality([1, 1, 2, 3, 4, 4, 4, 5], >, 1)}


This example returns

[1, 4]

since 1 and 4 are occurring more than once in the list.


%{filterByCardinality([1, 1, 2, 3, 4, 4, 4, 5], =, 1)}


This example returns

[2, 3, 5]

since these values are occurring exactly once in the list.



Parameters used in this function

ParameterInput (data type)Description
numberList

Any given number list.
operator

One of the following comparison operators: =, !=, <, <=, > and >=.
number

Any given number that will be used in combination with the operator to filter the given list.



This function returns a .

If the number list is empty or the comparison won't be fullfilled by any element, the function returns an empty .



Text list

A variant for text lists.


filterByCardinality(textList, operator, number) #Output: Text list



Parser expressionDescription


%{filterByCardinality(["tiger", "tiger", "lion", "lion", "cat", "lynx", "tiger"], <, 3)}


This example returns

["lion", "cat", "lynx"]

since these elements are occurring less than 3 times in the list.


%{filterByCardinality(toStringList(jiraExpression("issue.subtasks.map(s=>s.components.map(c=>c.name))")), =,count(subtasks()))}


This example returns a text list with those Components who are present in all sub-tasks.

To achieve this, the following functions are used:



Parameters used in this function

ParameterInput (data type)Description
textList

Any given text list.

operator

One of the following comparison operators: =, !=, <, <=, > and >=.
number

Any given number that will be used in combination with the operator to filter the given list.



This function returns a .

If the number list is empty or the comparison won't be fullfilled by any element, the function returns an empty .



Issue list

A variant for issue lists.


filterByCardinality(issueList, operator, number) #Output: Issue list



Parser expressionDescription


%{filterByCardinality(linkedIssues(), >, 1)}


This example returns an issue list with all issues that are linked to the current issue more than once.

To achieve this, the following functions are used:



Parameters used in this function

ParameterInput (data type)Description
issueList

Any given issue list. Usually this value is retrieved from a function (e.g. linkedIssues() or subtasks()).
operator

One of the following comparison operators: =, !=, <, <=, > and >=.
number

Any given number that will be used in combination with the operator to filter the given list.



This function returns an .

If the number list is empty or the comparison won't be fullfilled by any element, the function returns an empty .



Use cases and examples




Status
Tech review

Style guide




Short description

Filters a given number, text, or issue list by the number of occurrence of elements.

Output

   

Available since


Label