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

Compare with Current View Page History

« Previous Version 10 Next »

Supported list types

Number list

This function returns the index of the specified element in a number list.

Syntax
indexOf(number, numberList) #Output: Number
Examples
Parser expressionDescription
indexOf(1, [5, 2, 1, 4, 1])

This example returns the number 3

indexOf(3, [5, 2, 1, 4, 1])
This example returns the number 0, since 3 is not in the provided list.
Additional information

Parameters used in this function

ParameterInput (data type)Description
number

NUMBER

Any given number.
numberList

NUMBER LIST

Any given number list.
Output

This function returns a NUMBER .

If the number is not part of the number list, the function returns 0.


Text list

Variant for text lists.

Syntax
indexOf(text, textList) #Output: Number
Examples
Parser expressionDescription
indexOf("blue", ["red", "blue", "green"])

This example returns the number 2

indexOf("orange", ["red", "blue", "green"])
This example returns the number 0, since "orange" is not part of the list.
Additional information

Parameters used in this function

ParameterInput (data type)Description
text

TEXT

Any given text.
textList

TEXT LIST

Any given text list.
Output

The function returns a NUMBER .

If the text is not part of the text list, the function returns 0.


Issue list

Variant for issue lists.

Syntax
indexOf(issueKey, issueList) #Output: Number
Examples
Parser expressionDescription
indexOf(%{issue.key}, issuesUnderEpic())

This example returns the index of the current issue of all issues under the current epic.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

ParameterInput (data type)Description
issueKey

TEXT

Any given issue key.
issueList

ISSUE LIST

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

This function returns a NUMBER .

If the issue key is not in the issue list, the function returns 0.


Variant where you define an issue list instead of an issue key.

Syntax
indexOf(issueList1, issueList2) #Output: Number
Examples
Parser expressionDescription
indexOf(linkedIssues(), subtasks())

This example returns the index of the first issue in linkedIssues() of all subtasks under the current issue.

To achieve this, the following functions are used:

Additional information

Parameters used in this function

ParameterInput (data type)Description
issueList1

ISSUE LIST

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

It will always the first issue of the list be taken to get the index, e.g. if the list is [ISSUE1, ISSUE2], the index of ISSUE1 will be retrieved.

issueList2

ISSUE LIST

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

This function returns a NUMBER .

If the first issue list is empty or the second list does not contain the issue, the function returns 0.