🚀 Effective since April 2020 and JWT version 2.9.0 Automation Toolbox for Jira is fully integrated into our top rated app Jira Workflow Toolbox (JWT)🚀

General Information

Throughout the documentation we refer to data types that can be used in the expression parser and its functions.

The most commonly use data types are listed below.

Most functions will accept string values so casting values to string is a very powerful function. Details can be found below in the converting data types section!
Additionally you can directly transform a field value to text using the following syntax: %{...anyfield}


Data typeDescriptionExample

BOOLEAN

Comparison operators return a logical value true or false , as well as some functions. isActive(string user_name)

NUMBER

This type represents numeric values, and is also used to store Date, Time and Date-Time (DATE_TIME) values. When storing any temporal value, the number represents the milliseconds elapsed since January 1, 1970, 00:00:00 GMT.
Number or Date-Time fields can be referenced as numbers using the following notation: {...somefield}.

1, 1.1, -1.1, .1, -.1

STRING

This type represents any kind of text or character string including all kinds of select and multi-select fields MULTI.

Any field type or data type is susceptible of being transformed to text, so any field can be referenced as a text-string value using the following notation: %{...anyfield}, and %{...anyfield.i} for Cascading Select or Multi-Cascading Select fields, where i is the index that represents the level to be accessed. (i = 0 is used for base level).
"Hello world"

NUMBER []

This type represents a collection of numeric values returned by various functions. The size may vary from 0 to any number of numeric values. It is used to read the value of a numeric field in a selection of issues. You can also use literals like  [1, 2, 3]. fieldValue(), append(), union(), except(), intersect() and distinct(), 
[1, 2, 3]

STRING []

This type represents a collection of string values returned by various functions. The size may vary from 0 to any number of string values. It is also used to read the value of a string field in a selection of issues. You can also use literals like  ["string_A", "string_B", "string_C"]. fieldValue(), append(), union(), except(), intersect() and distinct(), 
["string_A", "string_B", "string_C"]

ISSUE []

This type represents a collection of issues. The size may vary from 0 to any number of issues.
It's returned by issue selection or filtering functions like subtasks(), linkedIssues(), filterByIssueType(), distinct(), etc.
subtasks(), linkedIssues(), transitionLinkedIssues(), filterByFieldValue(), filterByStatus(), filterByIssueType(), filterByResolution(), filterByProject(), append(), union(), except(), intersect() and distinct()

Converting data types

There are multiple functions available for converting or casting data types. A comprehensive list can be found below.

FunctionInputOutput
toString(number n)

NUMBER

DATE_TIME

Returns a STRING with the decimal representation of the numeric value in n. Numeric value of a Date-Time field is number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT.

Example: toString(3.141592) returns "3.141592".

toString(number n, number decimals)

NUMBER

Returns a STRING with the decimal representation of the numeric value in n limiting the fractional part to the number of digits in parameter decimals.

Example: toString(3.141592, 2) returns "3.14" .

toString(number list l)

NUMBER []

Returns a STRING with a comma separated list of decimal representation of the numeric values  in l.

Example: toString([1, 2, 3, 4.0]) returns "1, 2, 3, 4" .

toString(number list l, number decimals)

NUMBER []

Returns a STRING with a comma separated list of decimal representations of the numeric values in l, with the number of characters in the decimal part specified by parameter decimals.

Example: toString([1.123, 2.452, 3.64612], 2) returns the following string: "1.12, 2.45, 3.65" .

toString(number list l, number decimals, string separator)

NUMBER []

Returns a STRING with a list of decimal representations of the numeric values in l, with the number of characters in the decimal part specified by parameter decimals and separated by string separator.

Example: toString([1.123, 2.452, 3.64612], 2, " : ") returns the following string: "1.12 : 2.45 : 3.65" .

toString(string list l)

STRING []

Returns a STRING with a comma separated list of string values in l.

Example: toString(["Hello", " ", "world", "!"]) returns "Hello, , world, !" .

toString(string list l, string separator)

STRING []

Returns a STRING a list of string values in l separated by string separator.

Example: toString(["blue", "red", "green"], "; ") returns "blue; red; green".

toString(issue list l

ISSUE []

Returns a STRING with a comma separated list of issue keys.

Example: toString(subtasks()) returns "CRM-5, CRM-6" , being CRM-5 and CRM-6 the keys of current issue's sub-tasks.

toString(issue list l, string separator)


ISSUE []

Returns a STRING with a list of issue keys separated by string separator.

Example: toString(subtasks(), " ") returns "CRM-5 CRM-6", being CRM-5 and CRM-6 the keys of current issue's sub-tasks.

toNumber(string s)

STRING

Returns the NUMBER represented by the string s. This function expects a decimal representation of a number. In case it is not possible to parse the s to number, null is returned.

Example: toNumber("3.14") returns 3.14 .

toInteger(string s, string radix)

STRING

Returns the NUMBER represented by the string s as a signed integer in the radix specified by argument radix.

Example: toInteger("ff", 16) returns 255 .

toStringList(string s, string separators)

STRING with a list of tokens separated by one or more characters

Returns a STRING [] with tokens in argument s separated by characters in argument separators. Leading and trailing spaces around each token are automatically removed.

Example: toStringList("red, orange, yellow; green; blue; purple", ",;") returns the following string list: ["red", "orange", "yellow", "green", "blue", "purple"] .

toStringList(multi-valued field field)

field code for a MULTI-value field in format %{...somefield}. Multi-valued fields are Multi Select, Checkboxes, Components, Versions, Multi User Picker, Multi Group Picker, Issue Pickers, Attachments and Labels.

Returns a STRING [] representing each of the values selected in the field.

Example: toStringList(%{...components}) returns a list of strings with each of the components selected in current issue.

toNumberList(string s, string separators)

STRING  with a list of numbers in decimal representation separated by one or more characters

This function expects in argument s a string containing numbers in decimal representation separated by characters in argument separators, and returns a NUMBER [].

Example: toNumberList("1, 3, 5; 7; 11; 13", ",;") returns the following number list: [1, 3, 5, 7, 11, 13] .

issueKeysToIssueList(string issue_keys)

STRING with a comma separated list of issue keys

Returns an ISSUE [] with all issues with keys in argument issue_keys. Argument issue_keys is a string containing a comma separated list of issue keys.

Example: issueKeysToIssueList("CRM-12, HT-254") returns an issue list with issues with keys CRM-12 and HT-254.


Automatic casting from Number to Text-String 

Whenever you write a numeric term at the right-hand side of concat operator + or a comparison operator like = , and the left-hand side is occupied by a text-string term, the parser will automatically transform the right-hand side term into a string

  • + (string concat): "His age is " + 30 is equivalent to "His age is " + toString(30)
  • = (any comparison operator): "30" = 30 is equivalent to "30" = toString(30)

On this page