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.


nthElement(numberList, position) #Output: Number



Parser expressionDescription


%{nthElement([5, 6, 7, 8], 3)}


This example returns:

7



Parameters used in this function

ParameterInput (data type)Description
numberList

Any given number list.
position

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



This function returns a

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

If the number list is empty, the function returns 



Text list

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


nthElement(textList, position) #Output: Text



Parser expressionDescription


%{nthElement(["blue", "red", "green"], 2)}


This example returns:

red



Parameters used in this function

ParameterInput (data type)Description
textList

Any given text list.
position

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



This function returns a

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

If the text list is empty, the function returns 



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.


nthElement(issueList, position) #Output: Issue list



Parser expressionDescription


%{nthElement(subtasks(), 2)}


This example returns the second sub-task of the current issue, e.g.:

IT-9289

To achieve this, the following functions are used:





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

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



This function returns an

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

If the issue list is empty, the function returns an empty 



Use cases and examples



Short description

Returns the nth element of a number, text or issue list.

Output