first()

Number list

This function returns the first element of a number list.

Bash
first(numberList) #Output: Number

Examples

Parser expression

Description

Bash
%{first([3, 2, 1, 0])}

This example returns:

3

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

numberList

number list

Any given number list.

Output

This function returns a number

If the number list is empty, the function returns  null


Text list

This function returns the first element of a text list.

Bash
first(textList) #Output: Text

Examples

Parser expression

Description

Bash
%{first(["blue", "red", "green"])}

This example returns:

blue

Bash
%{first(%{issue.components})}

This exmaple returns the first component of the current issue, e.g:

IT

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

textList

text list

Any given text list.

Output

This function returns a text

If the text list is empty, the function returns  null


Issue list

The function returns an issue list with the first element of the given issue list.

Bash
first(issueList) #Output: Issue list

Examples

Parser expression

Description

Bash
%{first(subtasks())}

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

IT-9289

To achieve this, the following functions are used:

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

issueList

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 issue list is empty, the function returns an empty  issue list


(books) Use cases and examples