Versions Compared

Key

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


Page properties
hiddentrue


Tech review

Status
colourRedGreen
titleflaggeddone
 Need technical input

Style guide

Status
colourGreen
titletododone

Page status

Status
colourGreen
titlecomplete

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



Panel

On this page

Table of Contents
exclude(On this page).*
stylecircle
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

JWT is capable of processing various types of lists, including text, number and issue lists. This page contains valuable information about working with lists.


The list data type is an ordered list of elements. Those elements have a certain data type (text or number).

It is possible to:

  • access individual elements (e.g. using the function nthElement()),
  • create lists out of virtual fields (e.g. using toStringList()) or
  • use the list functions presented on this page to work with lists.

Fixed values

A  list can be written in literal as a comma separated list of texts in double quotes written inside brackets.

ExpressionDescription


Code Block
languagebash
linenumberstrue
[] #All lists are enclosed in brackets.


An empty list.


Code Block
languagebash
linenumberstrue
["Blue", "Green", "Yellow", "Orange", "Red"]


A text list with five elements.


Code Block
languagebash
linenumberstrue
[1,2,3]


A number list with three elements.


Code Block
languagebash
linenumberstrue
[1, {issue.subtasks.count}, {issue.links.count}]


A number list with three elements using field codes and JWT expression parser functions.

To achieve this, the following virtual field codes:


Code Block
languagebash
linenumberstrue
toStringList(%{issue.components})


A text list with all components of the current issue.

UI Text Box
typeinfo

Fields codes of multi-valued fields, such as components, labels, etc. by default return a text with a comma separated list of values. If you want to individually process these elements, you need to convert the text into a text list using toStringList().

Learn more about Converting data types


Reading values from issue lists

Most of the times, lists are being defined or returned using field codes or JWT expression parser functions. In order to read or retrieve values from an issue list, functions such as fieldValue() must be used.

ExpressionDescription


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


A list of all assignees of the current issues's sub-tasks.

The list may contain duplicate user names.

To achieve this, the following functions were used:


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


A list of all distinct assignees of the current issues's sub-tasks.

The list only contains unique user names.

To achieve this, the following functions were used:


Code Block
languagebash
linenumberstrue
fieldValue(%{issue.priority}, linkedIssues("blocks, is cloned by"))
List


A list of priorities of those issues linked to current issue through issue link types "blocks" and "is cloned by".

To achieve this, the following functions were used:


Code Block
languagebash
linenumberstrue
distinct(
toStringList(toString(
fieldValue(%{issue.components}, 
subtasks
issuesUnderEpic()))
, ","))


A

text

list with distinct components of

all sub-tasks of

all issues which are linked to same epic as the current issue.

To achieve this, the following functions were used:

()
  • toStringList()
  • toString
    subtasks



    Excerpt


    UI Text Box
    sizemedium
    typeinfo

    JWT offers individual operators that can be used when working with Listswith Lists.


    Available operators

    Page properties report
    firstcolumnFunction
    headingsShort description, Output
    cqllabel = "list_managment_operator" and space = currentSpace()


    Order of operations

    If you use multiple operators in a single expression, they will follow a certain order in which they are processed or a precedence.

    OPERATORSPRECEDENCEASSOCIATIVITY
    INTERSECT1 (highest)Left-to-right
    APPENDEXCEPTUNION2 (lowest)Left-to-right


    UI Text Box
    typetip
    • When using the list operators, you have to make sure that both lists that you compare are of the same type.
    • All operators are case insensitive, i.e., they can also be written in lower case: append, union, intersect and except.
    • There are four equivalent functions available for each type of list, and their behavior is exactly equivalent to that of its corresponding operator.
    • This way, you can choose to use operators or functions according to your preference. Although operators yield shorter expressions and with fewer parentheses, the usage of functions produces a more functional consistent syntax.


    Search
    placeholderTextSearch

    through the available functions

    for an available parser function
    cql

    Label

    label = list_function

    Image RemovedAvailable functions

    and ancestor = 29525218

    List functions for multiple list types

    UI Text Box
    typeinfo

    The following list contains all the available functions that work with all kinds of lists; text, number and issue lists.

    Page properties report
    firstcolumnFunction
    headingsShort description, Output, Label
    sortByTitle
    cqllabel

    in (

    = "list_function" and ancestor = currentContent()

    Number list (only) functions

    UI Text Box
    typeinfo

    The following list contains all the available functions that work with number lists only.

    Page properties report
    firstcolumnFunction
    headingsShort description, Output, Label
    sortByTitle
    cqllabel = "number_function" and space = currentSpace() and ancestor = currentContent()

    Issue list (only) functions

    UI Text Box
    typeinfo

    The following list contains all the available functions that work with issue lists only.

    Page properties report
    firstcolumnFunction
    headingsShort description, Output, Label
    sortByTitle
    cqllabel = "issue_list" and space = currentSpace() and ancestor = currentContent()


    Excerpt Include
    DECADIS:Contact support
    DECADIS:Contact support
    nopaneltrue