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.

Syntax
filterByCardinality(numberList, operator, number) #Output: Number list
Examples
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.

Additional information

Parameters used in this function

ParameterInput (data type)Description
numberList

NUMBER LIST

Any given number list.
operator

OPERATOR

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

NUMBER

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

This function returns a NUMBER LIST.

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


Text list

A variant for text lists.

Syntax
filterByCardinality(textList, operator, number) #Output: Text list
Examples
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.

Syntax
%{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:

Additional information

Parameters used in this function

ParameterInput (data type)Description
textList

TEXT LIST

Any given text list.

operator

OPERATOR

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

NUMBER

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

This function returns a TEXT LIST.

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


Issue list

A variant for issue lists.

Syntax
filterByCardinality(issueList, operator, number) #Output: Issue list
Examples
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:

Additional information

Parameters used in this function

ParameterInput (data type)Description
issueList

ISSUE LIST

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

OPERATOR

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

NUMBER

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

This function returns an ISSUE LIST.

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


Use cases and examples