Supported list types


Number list

This function filters a number list by a given logical expression where ^ is used for referencing the current list value.

It basically iterates over each list element, checks whether the logical expression returns true, and if it does, includes the element in the output.


filterByPredicate(numberList, logicalExpression) #Output: Number list



Parser expressionDescription


filterByPredicate([1, 2, 3, 4], ^% > 2)


This example returns a number list with values greater than 2:

[3, 4]


filterByPredicate([1, 2, 3, 4], modulus(^%, 2) = 0) 


This example returns a number list with even values:

[2, 4]

To achieve this, the following functions are used:

For additional mathematical functions, see Numbers.




Parameters used in this function

ParameterInput (data type)Description
numberList

Any given number list.
logicalExpression

A logical expression that returns true or false.

^ is used for referencing the field codes of the seed issue.



This function returns a



Text list

Variant for text lists. The current list value is referenced by ^%.


filterByPredicate(textList, logicalExpression) #Output: Text list



Parser expressionDescription


filterByPredicate(["book", "rose", "sword"], length(^%) > 4)


This example returns a text list with words that have more than 4 characters:

["sword"]


filterByPredicate(["book", "rose", "sword"], ^% in %{issue.summary} OR ^% in %{issue.description})


This example returns a text list with those words that also appear in the issue's summary or description.



Parameters used in this function

ParameterInput (data type)Description
textList

Any given text list.
logicalExpression

A logical expression that returns true or false.

^% is used for referencing the field codes of the seed issue.



This function returns a



Issue list

Variant for issue lists.


filterByPredicate(issueList, logicalExpression) #Output: Issue list



Parser expressionDescription


filterByPredicate(linkedIssues(), ^%{issue.summary} ~ %{issue.summary}) 


This example returns an issue list with linked issues (see linkedIssues()) that have the same summary like the current issue.


filterByPredicate(issuesUnderEpic(), ^%{issue.assignee} = null) 


This example returns an issue list with all unassigned issues under the current epic (see issuesUnderEpic()).


filterByPredicate(linkedIssues("blocks"), ^%{issue.resolution} = null AND ^{issue.priority} < {issue.priority})


This example returns an issue list with unresolved blocked issues with a higher priority than the current issue.



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()).
blogicalExpression

A logical expression that returns true or false.

^% is used for referencing the field codes of the seed issue.



This function returns an


This is one of the most powerful functions in JWT since it combines filtering with boolean or logical expressions

To freshen up your knowledge or to get some inspiration head over to:


Use cases and examples



Parser function cloud
Map(question)
Notes

Workaround

Text list

let list = ["abc", "def", "ghij", "klmn"];
list.filter(t=> t.length>3)

Number list

let list = [3,2,5,1,6,0];
list.filter(t=> t>3)


Issue list

let current = issue;
let list = issue.links.map(l=>l.linkedIssue);
list.filter(i=>i.priority>=issue.priority)

It won't be possible to use the seed itself, but as long as you have the current issue and the list of issues in variables, it's possible to replicate the functionality.






Status
Tech review

Style guide




Short description

Filters a number, issue, or a text list by a given logical expression.

Output

Available since

Label