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 the nth element of a number, string or issue list.

Output Statussubtletruetitlenumber Statussubtletruetitletext  Statussubtletruetitleissue list Panel

Supported list types

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


Number list

UI Text Box
sizemedium
typeinfo

This function returns the nth element of the given number list. N specifies the position of an element in a list.


Code Block
languagebash
titleSyntax
linenumberstrue
nthElement(listnumberList, position) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
%{nthElement([5, 6, 7, 8], 3) }


This example returns:

7



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
listnumberList

Status
subtletrue
titlenumber list

Any given number list.
position

Status
subtletrue
titlenumber

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



UI Expand
titleOutput

This function returns a

Status
subtletrue
titlenumber
.

If the position is out of bounce bounds (position <= 0 or position > count(list)), the function returns 

Status
subtletrue
titlenull
. In case the position is less than 1, an error is returned.

If the number list is empty, the function returns 

Status
subtletrue
titlenull
.



Text list

UI Text Box
sizemedium
typeinfo

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


Code Block
languagebash
titleSyntax
linenumberstrue
nthElement(listtextList, position) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
%{nthElement(["blue", "red", "green"], 2)}


This example returns :

red



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
listtextList

Status
subtletrue
titletext list

Any given text list.
position

Status
subtletrue
titlenumber

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



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext
.

If the position is out of bounce bounds (position <= 0 or position > count(list)), the function returns 

Status
subtletrue
titlenull
. In case the position is less than 1, an error is returned.

If the text list is empty, the function returns 

Status
subtletrue
titlenull
.



Issue list

UI Text Box
sizemedium
typeinfo

This function returns an issue list with the nth element of the given issue list. N specifies the position of an element in a list.


Code Block
languagebash
titleSyntax
linenumberstrue
nthElement(listissueList, position) #Output: Issue list


UI Expand
titleExamples


sub-task of the current issue, e.g.:

IT-9289

To achieve this, the following functions are used:

If an issue has the following subtasks [SUB-1, SUB-2, SUB-3], the output would be [SUB-2].




Parser expressionDescription


Code Block
languagebash
linenumberstrue
%{nthElement(subtasks(), 2)}


Returns This example returns the second issue retrieved by the function subtasks().

Info



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
listissueList

Status
subtletrue
titleissue list

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

Status
subtletrue
titlenumber

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



UI Expand
titleOutput

This function returns a an

Status
subtletrue
titleissue list
.

If the position is out of bounce bounds (position <= 0 or position > count(list)), the function returns an empty 

Status
subtletrue
titleissue list
. In case the position is less than 1, an error is returned.

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

Status
subtletrue
titleissue list



Image AddedUse cases and examples

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


Page properties
hiddentrue


Short description

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

Output

Status
subtletrue
titlenumber
Status
subtletrue
titletext
 
Status
subtletrue
titleissue list