You can 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.
All these functions are extremely helpful if you have rather large or complex expressions.
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>" |
To achieve this the conditional operator was used.
Available functions
Function | Output | Short description | Available since |
---|---|---|---|
setStringList() | TEXT LIST | Creates a variable to temporarily store a text list. | 2.6.0 |
setString() | TEXT | Creates a variable to temporarily store a text. | 2.6.0 |
setNumberList() | NUMBER LIST | Creates a variable to temporarily store a number list. | 2.6.0 |
setNumber() | NUMBER | Creates a variable to temporarily store a number | 2.6.0 |
setIssueList() | ISSUE LIST | Creates a variable to temporarily store an issue list. | 2.6.0 |
setBoolean() | BOOLEAN | Creates a variable to temporarily store a boolean value | 2.6.0 |
getStringList() | TEXT LIST | Returns values stored in a text list variable. | 2.6.0 |
getString() | TEXT | Returns the value stored in an text variable. | 2.6.0 |
getNumberList() | NUMBER LIST | Returns values stored in a number list variable. | 2.6.0 |
getNumber() | NUMBER | Returns a value stored in a number variable. | 2.6.0 |
getIssueList() | ISSUE LIST | Returns values stored in an issue list variable. | 2.6.0 |
getBoolean() | BOOLEAN | Returns a value stored in a boolean variable. | 2.6.0 |