Versions Compared

Key

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


Page properties
hiddentrue



Status
Tech review

Status
colourYellowGreen
titleReady for reviewdone

Style guide

Status
colourYellowGreen
titleReady for reviewdone

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



Page properties
hiddentrue


Short description

Sorts a given list in a specified specific order.

Output

Status
subtletrue
titlelist

Available since

Status
subtletrue
colourBlue
title2.1.27




Panel

Supported list types

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


Number list

UI Text Box
sizemedium
typeinfo

This function sorts a given number list in a specified order. Available orders are ASC (for ascending order) and DESC (for descending order).


Code Block
languagebash
titleSyntax
linenumberstrue
sort(numberList, order) #Output: Number list


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
sort([2, 4, 3, 1], ASC) 


This example returns the following number list :

[1, 2, 3, 4]


Code Block
languagebash
linenumberstrue
sort(fieldValue({issue.cf10110}, linkedIssues()), DESC)


This example returns a number list with the e.g. the Story Points of all linked issues in descending order.

To achieve this, the following functions are used:

(warning) Note that {issue.cf10110} is the field code for Story Points. It might differ on your instance.



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
numberList

Status
subtletrue
titlenumber list

Any given number list.
order

Status
subtletrue
titletext

Available orders are ASC (for ascending order) and DESC (for descending order).



UI Expand
titleOutput

The function returns a

Status
subtletrue
titlenumber list



Text list

UI Text Box
sizemedium
typeinfo

Variant for text lists.


Code Block
languagebash
titleSyntax
linenumberstrue
sort(textList, order) #Output: Text list


UI Expand
titleExamples


Parser expressionDescription


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


This example returns the following text list :

["blue", "green", "red"]


Code Block
languagebash
linenumberstrue
sort(fieldValue(%{issue.assignee}, subtasks()), ASC)


This example returns a text list with all sub-tasks's assignees in ascending order.

To achieve this, the following functions are used:



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
textList

Status
subtletrue
titletext list

Any given text list.
order

Status
subtletrue
titletext

Available orders are ASC (for ascending order) and DESC (for descending order).



UI Expand
titleOutput

The function returns a

Status
subtletrue
titletext list



Issue list

UI Text Box
sizemedium
typeinfo

Variant for issue lists.

In this case, a field has to be provided that should be used for the sort order. Available orders are ASC (for ascending order) and DESC (for descending order).


Code Block
languagebash
titleSyntax
linenumberstrue
sort(issueList, field, order) #Output: Issue list


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
sort(linkedIssues("is blocked by"), {issue.dueDate}, ASC)


This example returns an issue list of issues blocking current issue, sorted in ascending order by Due date.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
sort(subtasks(), %{issue.assignee}, ASC)


This example returns an issue list of sub-tasks ordered by , sorted in ascending order by their assignee.

To achieve this, the following functions are used:



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
issueList

Status
subtletrue
titleissue list

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

Status
subtletrue
titletext

Any field code representing a number, text or selectable field.
order

Status
subtletrue
titletext

Available orders are ASC (for ascending order) and DESC (for descending order).



UI Expand
titleOutput

The function returns an

Status
subtletrue
titleissue list