You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

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

A common use case i text list representing each of the selected elements of a selectable field.

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

Syntax
toStringList(text) #Output: Text list
Examples
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"]

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

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

"ui, portal"

To achieve this, the following functions are used:

Additional information

Parameters used in this function

ParameterInput (data type)Description
text

TEXT

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

This function is often used in combination with Selectable fields.

Output

The function returns a TEXT LIST


Variant where you can additionally define custom separators.

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

Syntax
toStringList(text, separators) #Output: Text list
Examples
Parser expressionDescription
toStringList("red, orange, yellow? green; blue; purple", ",?;")

This example returns the following text list:

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

Additional information

Parameters used in this function

ParameterInput (data type)Description
text

TEXT

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

separators

TEXT

Any separator character.
Output

The function returns a TEXT LIST