Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue
Status
Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged

Page properties
hiddentrue
Short descriptionReturns a  Statussubtletruetitlelist in l that validate predicate.Output Statussubtletruetitlelist Panel

Supported list types

Table of Contents
exclude(Supported list types).*
stylecircle
typeflat
separatorpipe


Number list

in l that validate predicate.Argument predicate is a boolean expression, where filters a number list by a given logical expression where ^ is used for referencing numeric values in argument lthe 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.

UI Text Box
sizemedium
typeinfo

The This function returns a 

Status
subtletrue
titlenumber list


Code Block
languagebash
titleSyntax
linenumberstrue
filterByPredicate(number list lnumberList, boolean expression predicatelogicalExpression) #Output: Number list


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
filterByPredicate([1, 2, 3, 4], ^^% > 2)


The function returns a

Status
subtletrue
titlenumber list
of This example returns a number list with values greater than 2:

[3, 4]


Code Block
languagebash
linenumberstrue
filterByPredicate([1, 2, 3, 4], remaindermodulus(^^%, 2) = 0) 


The function returns a

Status
subtletrue
titlenumber list
of This example returns a number list with even values:

[2, 4]

To achieve this, the following functions are used:

ui-text-box
typetip

For additional mathematical functions, see Numbers.




ui-expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>numberList

Status
subtletrue
titledata typenumber list

Any given number listParameter description.
<parameter>logicalExpression

Status
subtletrue
title

data type
text

A logical expression that returns true or false.

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

Parameter description

.



UI Expand
titleOutput

The This function returns a

Status
subtletrue
titlenumber list



Text list

with texts in l that validate predicate. Argument predicate is a boolean expression, where ^% is used for referencing string values in argument lVariant for text lists. The current list value is referenced by ^%.

UI Text Box
sizemedium
typeinfo

Returns a

Status
subtletrue
titletext list


Code Block
languagebash
titleSyntax
linenumberstrue
filterByPredicate(string list ltextList, boolean expression predicatelogicalExpression) #Output: Text list


UI Expand
titleExamples


: ["sword"]

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

Parser expressionDescription


Code Block
languagebash
linenumberstrue
filterByPredicate(["book", "rose", "sword"], length(^%) > 4)


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

The function returns a

Status
subtletrue
titletext list


Code Block
languagebash
linenumberstrue
filterByPredicate(["book", "rose", "sword"], ^% in %{00000issue.summary} OR ^% in %{00001issue.description})


The function returns a

Status
subtletrue
title



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
<parameter>textList

Status
subtletrue
titledata typetext list

Any given text listParameter description.
<parameter>logicalExpression

Status
subtletrue
title

data type
text

A logical expression that returns true or false.

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

Parameter description

.



UI Expand
titleOutput

The This function returns a

Status
subtletrue
titletext list



Issue list

UI Text Box
sizemedium
typeinfo

The function returns an

Status
subtletrue
titleIssue list
  with issues in l whose cardinality (i.e., the number of times it appears in list l) satisfies the comparison cardinality operator n.

Available comparison operators: =, !=, <, <=, > and >=.Variant for issue lists.


Code Block
languagebash
titleSyntax
linenumberstrue
filterByCardinality(issue list l, comparison operator operator, number nfilterByPredicate(issueList, logicalExpression) #Output: Issue list


UI Expand
titleExamples


with all issues linked to current issue with 2 or more issue links


Parser expressionDescription


Code Block
languagebash
linenumberstrue
filterByCardinalityfilterByPredicate(linkedIssues(), >, 1^%{issue.summary} ~ %{issue.summary}) 
The function returns an
Status
subtletrue
titleissue list

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


Code Block
languagebash
linenumberstrue
filterByPredicate(issuesUnderEpic(), ^%{issue.assignee} = null) 


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


Code Block
languagebash
linenumberstrue
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.



UI Expand
titleAdditional information

Parameters used in this function

<parameter>
ParameterInput (data type)Description
<parameter>issueList

Status
subtletrue
titledata type

Parameter description.

issue list

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

Status
subtletrue
title

data typeParameter description.

text

A logical expression that returns true or false.

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



UI Expand
titleOutput

This function returns an

Status
subtletrue
title

data typeParameter description.
UI Expand
titleOutput

issue list


UI Text Box
typetip

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:


Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_filterbypredicate" and space = currentSpace()


Page properties
hiddentrue
id1


Parser function cloud
Map(question)
Notes

Workaround

Text list

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

Number list

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


Issue list

Code Block
languagebash
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.




Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



issue list
Page properties
hiddentrue


Short description

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

Output

Status
subtletrue
titlelist

Available since

Status
subtletrue
colourBlue
title2.1.32

Label

Status
colourRed
titlestaff pick

The function returns an
Status
subtletrue
title