Supported list types


Number list

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


indexOf(number, numberList) #Output: Number



Parser expressionDescription


indexOf(1, [5, 2, 1, 4, 1])


This example returns

3


indexOf(3, [5, 2, 1, 4, 1])


This example returns the 0, since 3 is not in the provided list.



Parameters used in this function

ParameterInput (data type)Description
number

Any given number.
numberList

Any given number list.



This function returns a .

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



Text list

Variant for text lists.


indexOf(text, textList) #Output: Number



Parser expressionDescription


indexOf("blue", ["red", "blue", "green"])


This example returns

2


indexOf("orange", ["red", "blue", "green"])


This example returns the 0, since "orange" is not part of the list.



Parameters used in this function

ParameterInput (data type)Description
text

Any given text.
textList

Any given text list.



The function returns a .

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



Issue list

Variant for issue lists.


indexOf(issueKey, issueList) #Output: Number



Parser expressionDescription


indexOf(%{issue.key}, issuesUnderEpic())


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

To achieve this, the following functions are used:



Parameters used in this function

ParameterInput (data type)Description
issueKey

Any given issue key.
issueList

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



This function returns a .

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.


indexOf(issueList1, issueList2) #Output: Number



Parser expressionDescription


indexOf(linkedIssues(), subtasks())


This example returns the index of the first linked issue which is also a subtask.

To achieve this, the following functions are used:



Parameters used in this function

ParameterInput (data type)Description
issueList1

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

The index will always be retrieved from the first element of the list. If the list returns [ISSUE1, ISSUE2], the index of ISSUE1 will be retrieved.

issueList2

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



This function returns a .

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



Use cases and examples



Parser function cloud
Map(question)
Notes

Workaround

let list = [11,7,3,2,5];
list.indexOf(2)







Status
Tech review

Style guide




Short description

Returns the index / position of a specific element in a list.

Output

Available since

Label