Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 1.1.0


Excerpt

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.

Tip

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


Data typeDescriptionExample

Status
colourGreen
titleBOOLEAN

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

Status
colourBlue
titlenumber

This type represents numeric values, and is also used to store Date, Time and Date-Time (

Status
titledate_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

Status
colourYellow
titleString

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

Status
titlemulti
.


Tip
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"

Status
subtletrue
colourBlue
titlenumber []

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]

Status
subtletrue
colourYellow
titleString []

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"]

Status
subtletrue
titleIssue []

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

Anchor
cast
cast

Transforming

Converting data types

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

FunctionInputOutput
toString(number n)

Status
colourBlue
titlenumber

Status
titledate_time

Returns a 

Status
colourYellow
titleString
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)

Status
colourBlue
titlenumber

Returns a

Status
colourYellow
titleString
 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)

Status
subtletrue
colourBlue
titlenumber []

Returns a 

Status
colourYellow
titleString
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)

Status
subtletrue
colourBlue
titlenumber []

Returns a 

Status
colourYellow
titleString
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)

Status
subtletrue
colourBlue
titlenumber []

Returns a 

Status
colourYellow
titleString
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)

Status
subtletrue
colourYellow
titleString []

Returns a 

Status
colourYellow
titleString
with a comma separated list of string values in l.

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

toString(string list l, string separator)

Status
subtletrue
colourYellow
titleString []

Returns a 

Status
colourYellow
titleString
a list of string values in l separated by string separator.

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

toString(issue list l

Status
subtletrue
titleIssue []

Returns a 

Status
colourYellow
titleString
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)


Status
subtletrue
titleIssue []

Returns a 

Status
colourYellow
titleString
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)

Status
colourYellow
titleString

Returns the 

Status
colourBlue
titlenumber
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)

Status
colourYellow
titleString

Returns the 

Status
colourBlue
titlenumber
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)

Status
colourYellow
titleString
 with a list of tokens separated by one or more characters

Returns a 

Status
subtletrue
colourYellow
titleString []
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

Status
titlemulti
-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 

Status
subtletrue
colourYellow
titleString []
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)

Status
colourYellow
titleString
 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 

Status
subtletrue
colourBlue
titlenumber []
.

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

issueKeysToIssueList(string issue_keys)

Status
colourYellow
titleString
 with a comma separated list of issue keys

Returns an 

Status
subtletrue
titleIssue []
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.


Info

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)




Div
styleline-height: 150%;
idtocContainer
classtocContainer


Panel
borderColor#333f48
bgColor#FFFFFF
titleColor#eeeeee
borderWidth1
titleBGColor#333f48
borderStylesolid
titleOn this page

Table of Contents
maxLevel3
minLevel2
indent20px
classp