Choice
The Choice datatype is used to represent a fixed set of choices.
This is a special datatype that is only used by System Properties, such as priority
, statusClassification
, and trendValue
.
Choices do not have any methods, and cannot be used with any operators besides the equality =
operator.
Equality
Choices can be compared for equality by using the choice name, without quotation marks.
this.object.statusClassification = RED
myRisk.priority = GREEN
Caution
In Reporter, standard Choice equality is not supported (including within #ext/#endExt
) and instead equality must be checked
by comparing the name property of the Choice to a hardcoded String. This is done by appending .name
at the end of the Choice property this.object.statusClassification.name
and comparing it to the name of the Choice as a hardcoded String.
This comparison is case-sensitive.
this.object.statusClassification.name = "RED"
myRisk.priority.name = "RiskType.powderGreen"
myRisk.priority.name = "RiskType.deepPurple"
Common Choice Property Names
The following tables contain the name values of the common Choice properties priority
, statusClassification
, and trendValue
.
If using the Choice name to check for equality, it must be hardcoded as a String (wrapped in quotes).
priority
Choice |
Choice Name (String) |
|
RiskType.darkgreen |
|
RiskType.deepPurple |
|
RiskType.deepRed |
|
RiskType.green |
|
RiskType.hotpink |
|
RiskType.lightGreen |
|
RiskType.midnightBlue |
|
RiskType.orange |
|
RiskType.pink |
|
RiskType.powderBlue |
|
RiskType.powderGreen |
|
RiskType.purple |
|
RiskType.red |
|
RiskType.royalBlue |
|
RiskType.steelBlue |
|
RiskType.yellow |
statusClassification
Choice |
Choice Name (String) |
|
BLUE |
|
DARK |
|
GREEN |
|
NONE |
|
ORANGE |
|
RED |
|
YELLOW |
trendValue
Choice |
Choice Name (String) |
|
NEGATIVE |
|
NEUTRAL |
|
POSITIVE |
|
UNAVAILABLE |
visibility
The visibility
property is used to access the value of the property displayed in Configuration Studio as “Visible”.
This is different from .visible
which is a special property that will return True or False if an Object is visible or not.
visibility
on the other hand is used to get the actual property value out (Visible, Not Visible, Only Visible for Admin, Only Visible when displayed as page).
Choice |
Choice Name (String) |
|
VISIBLE |
|
NOVISIBLE |
|
ADMINVISIBLEONLY |
|
VISIBLEASPARENTONLY |