This function converts a comma-separated text into a text list.

A common use case is a text list representing the selected elements of a selectable field, e.g. components.


If you want to test the output or need the actual text instead of a list, wrap your expression in a toString() function.


toStringList(text) #Output: Text list



Parser expressionDescription


toStringList(%{issue.components})


This example returns a text list with each of the components selected in the current issue, e.g.:

["ui", "portal"]


count(toStringList(%{issue.labels}))


This example returns the number of labels attached to the current issue, e.g.:

2

To achieve this, the following functions are used:



Parameters used in this function

ParameterInput (data type)Description
text

Any comma-separated text satisfying the format: "Element1, Element2".

This function is often used in combination with Selectable field options.



The function returns a




Variant where you can additionally define custom separators.

Leading and trailing spaces around each list element are automatically removed.


toStringList(text, separators) #Output: Text list



Parser expressionDescription


toStringList("red, orange, yellow? green; blue; purple", ",?;")


This example returns the text list:

["red", "orange", "yellow", "green", "blue", "purple"]



Parameters used in this function

ParameterInput (data type)Description
text

Any text with elements separated by the characters defined in the second argument.

separators

Any separator character.



The function returns a



Use cases and examples



Parser function cloudtoStringList()
Map(tick)
Notes






Status
Tech review

Style guide




Short descriptionConverts text into a text list.
Output

Available since
Label