You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


Supported list types

Number list

This function returns the nth element of the given number list. N specifies the position of an element in a list.

Syntax
nthElement(list, position) #Output: Number
Examples
Parser expressionDescription
%{nthElement([5, 6, 7, 8], 3)}

This example returns:

7

Additional information

Parameters used in this function

ParameterInput (data type)Description
list

NUMBER LIST

Any given number list.
position

NUMBER

A number satisfying the following condition: 1 <= position <= count(list)
Output

This function returns a NUMBER .

If the position is out of bounds (position > count(list)), the function returns NULL. In case the position is less than 1, an error is returned.

If the number list is empty, the function returns NULL.


Text list

This function returns the nth element of the given text listN specifies the position of an element in a list.

Syntax
nthElement(list, position) #Output: Text
Examples
Parser expressionDescription
%{nthElement(["blue", "red", "green"], 2)}

This example returns:

red

Additional information

Parameters used in this function

ParameterInput (data type)Description
list

TEXT LIST

Any given text list.
position

NUMBER

A number satisfying the following condition: 1 <= position <= count(list)
Output

This function returns a TEXT.

If the position is out of bounds (position > count(list)), the function returns NULL. In case the position is less than 1, an error is returned.

If the text list is empty, the function returns NULL.


Issue list

This function returns an issue list with the nth element of the given issue listN specifies the position of an element in a list.

Syntax
nthElement(list, position) #Output: Issue list
Examples
Parser expressionDescription
%{nthElement(subtasks(), 2)}

Returns the second issue retrieved by the function subtasks().

If an issue has the following subtasks [SUB-1, SUB-2, SUB-3], the output would be [SUB-2].

Additional information

Parameters used in this function

ParameterInput (data type)Description
list

ISSUE LIST

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

NUMBER

A number satisfying the following condition: 1 <= position <= count(list)
Output

This function returns a ISSUE LIST.

If the position is out of bounds (position > count(list)), the function returns an empty ISSUE LIST. In case the position is less than 1, an error is returned.

If the issue list is empty, the function returns an empty ISSUE LIST.