Page History
Section | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Since version 2.6.0 it is now possible to temporarily store values . Having this capability makes it possible to reference these values later on in the through functions. Stored values can easily be retrieved or referenced later in the same expression.
Example
Info |
---|
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. |
setNumber("x",
toNumber(
count(
issuesFromJQL("issue in linkedIssues('" + %{Issue key} + "','blocks','is blocked by')")
)
)
) > 5 ? "
<font color=\"red\">" + getNumber("x") + "</font>"
: "<font color=\"green\">" + getNumber("x") + "</font>"Expressions
Function | Returned value |
---|---|
setNumber(string variable_name, number value) : number | Returns value and stores it into an internal numerical variable called variable_name. |
getNumber(string variable_name) : number | Returns the numeric value stored into internal variable called variable_name. |
setString(string variable_name, string value) : string | Returns value and stores it into an internal string variable called variable_name. |
getString(string variable_name) : string | Returns the string value stored into internal variable called variable_name. |
setNumberList(string variable_name, number list value) : number list | Returns value and stores it into an internal numerical list variable called variable_name. |
getNumberList(string variable_name) : number list | Returns number list value stored into an internal variable called variable_name. |
setStringList(string variable_name, string list value) : string list | Returns value and stores it into an internal string list variable called variable_name. |
getStringList(string variable_name) : string list | Returns string list value stored into an internal variable called variable_name. |
setIssueList(string variable_name, issue list value) : issue list | Returns value and stores it into an internal issue list variable called variable_name. |
getIssueList(string variable_name) : issue list | Returns issue list value stored into an internal variable called variable_name. |
setBoolean(string variable_name, boolean value) : boolean | Returns value and stores it into an internal variable variable called variable_name. |
getBoolean(string variable_name) : boolean | Returns boolean value stored into an internal variable called variable_name. |
Note that every setter method always returns the stored value so that it can be immediately used for saving and calling the value in the expression (as seen in the example above).
Example
Tip | ||
---|---|---|
| ||
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>" |