SINCE VERSION 2.6.0
Since version 2.6.0 it is possible to temporarily store values through functions. Stored values can easily be retrieved or referenced later in the same expression.
Functions used to retrieve (get) values previously stored (set) can directly be used in the same expression.
The values can only be used for the current expression and cannot be reused in another expression.
Expressions
Function | Returned value |
---|---|
setBoolean(string variable_name, boolean value) : boolean | Creates a variable named variable_name for storing a boolean value, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getBoolean(string variable_name) : boolean | Returns the value stored in a boolean variable named variable_name, which was previously created using the setBoolean() function. Example: |
setNumber(string variable_name, number value) : number | Creates a variable named variable_name for storing a number, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getNumber(string variable_name) : number | Returns the value stored in a numeric variable named variable_name, which was previously created using the setNumber() function. Example: |
setString(string variable_name, string value) : string | Creates a variable named variable_name for storing a string, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getString(string variable_name) : string | Returns the value stored in string variable named variable_name, which was previously created using the setString() function. Example: |
setNumberList(string variable_name, number list value) : number list | Creates a variable named variable_name for storing a number list, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getNumberList(string variable_name) : number list | Returns the value stored in number list variable named variable_name, which was previously created using the setNumberList() function. Example: |
setStringList(string variable_name, string list value) : string list | Creates a variable named variable_name for storing a string list, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getStringList(string variable_name) : string list | Returns the value stored in string list variable named variable_name, which was previously created using the setStringList() function. Example: |
setIssueList(string variable_name, issue list value) : issue list | Creates a variable named variable_name for storing an issue list, and assigns it a value, which is also returned in order to be used within an expression. Example: |
getIssueList(string variable_name) : issue list | Returns the value stored in issue list variable named variable_name, which was previously created using setIssueList() function. Example: |
Example
EXAMPLE
You want to emphasize the importance of blocking issues by returning AND coloring the number of linked blocking issues.
If more than 3 issues are linked as blocking issues the exact number will be returned in red otherwise in green.
The number will directly be saved (set) and later referenced as x via the set/get method/function.
Before value storage | After value storage |
---|---|
count(linkedIssues("is blocked by")) > 3 ? "<font color=\"red\">" + count(linkedIssues("is blocked by")) + "</font>" : "<font color=\"green\">" + count(linkedIssues("is blocked by")) + "</font>" | setNumber("x", count(linkedIssues("is blocked by")) > 3 ? "<font color=\"red\">" + getNumber("x") + "</font>" : "<font color=\"green\">" + getNumber("x") + "</font>" |