Versions Compared

Key

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


Page properties
hiddentrue
Status
Tech review

Status
colourYellow
titleReady for review

Style guide

Status
colourYellow
titleReady for review

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

Page properties
hiddentrue
Short description

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

Output Statussubtletruetitletext  Statussubtletruetitlenumber  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 last element of a number list.


Code Block
languagebash
titleSyntax
linenumberstrue
last(listnumberList) #Output: Number


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
%{last([3, 2, 1, 0])} 


This example returns:

0



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
listnumberList

Status
subtletrue
titlenumber list

Any given number list.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titlenumber
.

If the number list is empty, the function returns 

Status
subtletrue
titlenull
.



Text list

UI Text Box
sizemedium
typeinfo

This function returns the last element of a text list.


Code Block
languagebash
titleSyntax
linenumberstrue
last(listtextList) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


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


This example returns:

green



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
listtextList

Status
subtletrue
titletext list

Any given text list.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext
.

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 last element of the given issue list.


Code Block
languagebash
titleSyntax
linenumberstrue
last(listissueList) #Output: Issue list


UI Expand
titleExamples


If subtasks() returns [SUB-1, SUB-2, SUB-3], the output will be:

[SUB-3]

of the current issue, e.g.:

IT-9289

To achieve this, the following functions are used:

Parser expressionDescription


Code Block
languagebash
linenumberstrue
%{last(subtasks())}


This example returns the last sub-task

returned by 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()).



UI Expand
titleOutput

This function returns an 

Status
subtletrue
titleissue list
.

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_last" and space = currentSpace()


Page properties
hiddentrue


Short description

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

Output

Status
subtletrue
titlenumber
 
Status
subtletrue
titletext
 
Status
subtletrue
titleissue list