Versions Compared

Key

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


UI Text Box
sizemedium
typeinfo

This function converts the decimal representation of a number (or timestamp) into plain text


UI Text Box
typetip

This is one of the most commonly used functions in JWT.

Whenever any type of list is returned by a field code or parser function (e.g. subtasks()) and you are using the advanced text parsing mode, the toString() function converts the output to a readable format.

This is especially helpful if you want to test your expression.


Code Block
languagebash
titleSyntax
linenumberstrue
 toString(number) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
toString(3.141592)


This example returns the text:

"3.141592"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
number

Status
subtletrue
titlenumber

Any given number or numerical field code.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext




UI Text Box
sizemedium
typeinfo

Variant where you can additionally define the number of decimal places.


Code Block
languagebash
titleSyntax
linenumberstrue
 toString(number, decimalPlaces) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
toString(3.141592, 2)


This example returns the text:

"3.14"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
number

Status
subtletrue
titlenumber

Any given number.
decimalPlaces

Status
subtletrue
titlenumber

Any positive number.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext



Image AddedNumber list

UI Text Box
sizemedium
typeinfo

This function converts any number list into plain text.

A comma-separated text with the decimal representation of each numeric value will be returned.


Code Block
languagebash
titleSyntax
linenumberstrue
 toString(numberList) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
toString([1, 2, 3, 4.0])


This example returns the text:

"1, 2, 3, 4"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
numberList

Status
subtletrue
titlenumber list

Any given number list.



UI Expand
titleOutput
Page properties
hiddentrue
Status
Tech review

Status
titletodo

Style guide

Status
titletodo

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

Page properties
hiddentrue
Short description<Short, generic description of the parser function(s) (if multiple parameters are available)Output

This function returns a

Status
subtletrue
titletext




UI Text Box
sizemedium
typeinfo

Variant where you can additionally define the number of decimal places.


Code Block
languagebash
titleSyntax
linenumberstrue
 toString(numberList, decimalPlaces) #Output: Text


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
toString([1.123, 2.452, 3.64612], 2)


This example returns the text:

"1.12, 2.45, 3.65"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
numberList

Status
subtletrue
title number list

Any given number list.
decimalPlaces

Status
subtletrue
titlenumber

Any positive number.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext




UI Text Box
sizemedium
typeinfo

Variant where you can additionally define a specific separatorDetailed description of the parser function.


Code Block
languagebash
titleSyntax
linenumberstrue
function toString(firstParameternumberList, secondParameterdecimalPlaces, thirdParameterseparator) #Output: NumberText


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
timeInValue(%{issue.summary}, ^% ~~ "ERROR" OR ^% ~~ "WARNING") / {HOUR}
toString([1.123, 2.452, 3.64612], 2, " : ")


This example returns the text:

"1.12 : 2.45 : 3.65"



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
numberList

Status
subtletrue
titlenumber list

Any given number list.
decimalPlaces

Status
subtletrue
titlenumber

Any positive number.
separator

Status
subtletrue
titletext

Any separator character.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titletext



Image AddedText list

UI Text Box
sizemedium
typeinfo

This function converts any text list into plain text.

A comma-separated text with each value will be returned.


Code Block
languagebash
titleSyntax
linenumberstrue
 toString(textList) #Output: Text


UI Expand
titleExamples


timeInValuecomponentscount(toStringList(^%, "," > 1 / {HOUR} number of hours the field components of the current issue contained more than one selected component.

This example uses the functions:

  • count()
  • xxxx
    Parser expressionDescription


    Code Block
    languagebash
    linenumberstrue
    toString(["Hello", " ", "world", "!"])


    This example returns the text:

    "Hello, , world, !"This example returns the number of hours the field summary of the current issue contained any of the words "ERROR" or "WARNING", ignoring the case.


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


    This example returns the

    user names of all sub-task reporters, e.g.:

    "b.smith, a.grant"

    To achieve this the following functions are used:

    Info



    UI Expand
    titleAdditional information

    Parameters used in this function

    firstParameter
    ParameterInput (data type)Description
    textList

    Status
    subtletrue
    titletext list

    Any given text list.



    UI Expand
    titleOutput

    This function returns a

    Status
    subtletrue
    titletext




    UI Text Box
    sizemedium
    typeinfo

    Variant where you can additionally define a specific separator.


    Code Block
    languagebash
    titleSyntax
    linenumberstrue
    toString(textList, separator) #Output: Text


    UI Expand
    titleExamples


    Parser expressionDescription


    Code Block
    languagebash
    linenumberstrue
    toString(["blue", "red", "green"], "; ")


    This example returns the text:

    "blue; red; green"



    UI Expand
    titleAdditional information

    Parameters used in this function

    string
    ParameterInput (data type)Description
    textListnumberThe input has to be a valid timestamp...secondParameter

    Status
    subtletrue
    title

    text list

    Any given text list.
    separator

    Parameter description. Read more about Working with lists

    thirdParameter

    Status
    subtletrue
    titletext

    Parameter descriptionAny separator character.



    UI Expand
    titleOutput

    The This function returns a

    Status
    subtletrue
    titletextnumber



    Image AddedIssue list

    UI Text Box
    sizemedium
    typetipinfo

    Converts an issue list into a comma-separated text containing issue keys.


    Code Block
    languagebash
    titleSyntax
    linenumberstrue
    toString(issueList) #Output: Text


    UI Expand
    titleExamples


    Parser expressionDescription


    Code Block
    languagebash
    linenumberstrue
    toString(subtasks())


    This example might return:

     "CRM-5, CRM-6 "

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



    UI Expand
    titleOutput

    This function returns a

    Status
    subtletrue
    titletext




    UI Text Box
    sizemedium
    typeinfo

    Variant where you can additionally define a specific separator.


    Code Block
    languagebash
    titleSyntax
    linenumberstrue
    toString(issueList, separator) #Output: Text


    UI Expand
    titleExamples


    Parser expressionDescription


    Code Block
    languagebash
    linenumberstrue
     toString(subtasks(), " ")


    This example might return: 

    "CRM-5 CRM-6 CRM-7"


    Code Block
    languagebash
    linenumberstrue
     toString(subtasks(), ";")


    This example might return: 

    "CRM-5;CRM-6;CRM-7"



    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()).
    separator

    Status
    subtletrue
    titletext

    Any separator character.



    UI Expand
    titleOutput

    This function returns a

    Status
    subtletrue
    titletext



    Image AddedUse cases and examples

    Page properties report
    firstcolumnUse case
    headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
    cqllabel = "parser_func_tostring" and space = currentSpace()


    Page properties
    hiddentrue
    id1


    Parser function cloudtoString()
    Map(tick)
    Notes




    Page properties
    hiddentrue



    Status
    Tech review

    Status
    colourGreen
    titledone

    Style guide

    Status
    colourGreen
    titledone

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



    Page properties
    hiddentrue


    Short description

    Converts numbers and lists into plain text.

    Output

    Status
    subtletrue
    titletext

    Available since
    Label

    Status
    colourRed
    titlestaff pick

    If there is more to say, say it or link to related functions...

    Are you looking for a more detailed representation? You might want to have a look at the function formatDuration()...