Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue
Status
Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged

Page properties
hiddentrue
Short description

Returns a number representing the index of numeric value element in number/text list l. Zero is returned when the element is not found in l.

Output Statussubtletruetitlenumber Available since

Status
subtletrue
colourBlue
title2.1.29

Panel

Supported list types

Table of Contents
exclude(Supported list types).*
stylecircle
typeflat
separatorpipe


Number list

UI Text Box
sizemedium
typeinfo

This function returns number representing the index / position of numeric value a specified element in a number list l. Zero is returned when the element is not found in l.


Code Block
languagebash
titleSyntax
linenumberstrue
indexOf(number element, number list lnumberList) #Output: Number


UI Expand
titleExamples


the number 3
Parser expressionDescription


Code Block
languagebash
linenumberstrue
indexOf(1, [5, 2, 1, 4, 1])


This example returns

3


Code Block
languagebash
linenumberstrue
indexOf(3, [5, 2, 1, 4, 1])


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



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
xxxnumber

Status
subtletrue
titledata typenumber

Any given numberParameter description.
xxxnumberList

Status
subtletrue
titledata typenumber list

Any given number listParameter description.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titlenumber
.

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



Text list

UI Text Box
sizemedium
typeinfo

This function returns a number representing the index of text element in the text list l. Zero is returned when the element is not found in l.Variant for text lists.


Code Block
languagebash
titleSyntax
linenumberstrue
indexOf(string elementtext, string list ltextList) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
indexOf("blue", ["red", "blue", "green"])


This example returns the number 2

2


Code Block
languagebash
linenumberstrue
indexOf("orange", ["red", "blue", "green"])


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



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
xxxtext

Status
subtletrue
titledata typetext

Any given textParameter description.
xxxtextList

Status
subtletrue
titledata typetext list

Any given text listParameter description.



UI Expand
titleOutput

The function returns a

Status
subtletrue
titlenumber
.

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



Issue list

UI Text Box
sizemedium
typeinfo

This function returns a number representing the index in issue list l of issue with key issue_key. Zero is returned when issue is not found in l.Variant for issue lists.


Code Block
languagebash
titleSyntax
linenumberstrue
indexOf(string issue_keyissueKey, issue list lissueList) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
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:



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
xxxissueKey

Status
subtletrue
titledata typetext

Any given issue keyParameter description.
xxxissueList

Status
subtletrue
titledata typeissue list

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



UI Expand
titleOutput

This function returns a

Status
subtletrue
titlenumber
.

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




UI Text Box
sizemedium
typeinfo

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


Code Block
languagebash
titleSyntax
linenumberstrue
indexOf(issue list elementissueList1, issue list lissueList2) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
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:



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
xxxissueList1

Status
subtletrue
titledata type

Parameter description.

issue list

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.

issueList2xxx

Status
subtletrue
titledata typeissue list

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



UI Expand
titleOutput

This function returns a

Status
subtletrue
titlenumber
.

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



Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_indexof" and space = currentSpace()


Page properties
hiddentrue
id1


Parser function cloud
Map(question)
Notes

Workaround

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





Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Page properties
hiddentrue


Short description

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

Output

Status
subtletrue
titlenumber

Available since

Status
subtletrue
colourBlue
title2.1.29

Label