except()

Number list

This function returns a number list of elements in a list which are not present in a second list.

The returned list does not contain duplicates. The order is respected.


Bash
except(numberList1, numberList2) #Output: Number list


Examples

Parser expression

Description

Bash
except([1, 2, 3, 4, 5], [2, 4])

This example returns

[1, 3, 5]

Bash
except([1, 1, 2, 3, 3], [2])

This example returns

[1, 3]

All duplicates will be removed from the list.

Bash
except([1, 1, 2, 3, 3], [])

This example returns

[1, 2, 3]

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

numeberList1

number list

Any given number list.

lnumberList2

number list

Any given number list.

Output

This function returns a number list .

If the first or both lists are empty, the function returns an empty  number list .


Text list

Variant for text lists.


Bash
except(textList1, textList2) #Output: Text list


Examples

Parser expression

Description

Bash
except(["blue", "red", "green", "black"], ["red", "green", "yellow"])

This example returns

["blue", "black"]

Bash
except(fieldValue(%{issue.fixVersion}, subtasks()), fieldValue(%{issue.fixVersion}, linkedIssues()))

This example returns a text list of Fix Version/s that are in sub-tasks and not in linked issues.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

textList1

text list

Any given text list.

textList2

text list

Any given text list.

Output

This function returns a text list .

If the first or both lists are empty, the function returns an empty  text list .


Issue list

Variant for issue lists.


Bash
except(issueList1, issueList2) #Output: Issue list


Examples

Parser expression

Description

Bash
except(linkedIssues(), subtasks())


This example returns an issue list of linked issues removing those which are also sub-tasks of current issue.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

issueList1

issue list

Any given issue list. Usually this value is retrieved from a function (e.g. 

linkedIssues()

or 

subtasks()

).

issueList2

issue list

Any given issue list. Usually this value is retrieved from a function (e.g. 

linkedIssues()

or 

subtasks()

).

Output

This function returns an issue list .

If the first or both lists are empty, the function returns an empty  issue list .

This function is the equivalent to the list operator EXCEPT and can be used interchangeably. 


📚 Use cases and examples