Skip to main content

Define an Enum Column

Add a column entry to your risksheet.json with the type property set to enum:YourEnumID:
{
  "columns": [
    {
      "id": "riskCategory",
      "header": "Risk Category",
      "binding": "riskCategory",
      "type": "enum:risk_category",
      "level": 2
    }
  ]
}
The identifier after the colon must match the key used in either the enums section of your risksheet.json or the Polarion custom field definition.

Choose the Right Enum Type

Risksheet provides three enum-related column types:
Type SyntaxSelectionDescription DisplayUse Case
enum:EnumIDSingle-selectName onlyStandard dropdown fields
rating:EnumIDSingle-selectName + descriptionRisk parameter scales (severity, occurrence, detection)
multiEnum:EnumIDMulti-selectName onlyFields allowing multiple values
Use rating:EnumID when each option needs context in the dropdown — for example, “5 — Catastrophic: Loss of life”. Use enum:EnumID for simple selection fields where the name alone is sufficient.

Define Custom Enumerations

If the enum options are not sourced from a Polarion-native field, define them in the enums section:
{
  "enums": {
    "severity_scale": [
      { "id": "1", "name": "Negligible", "description": "No injury or minor discomfort" },
      { "id": "2", "name": "Minor", "description": "Reversible injury, not life-threatening" },
      { "id": "3", "name": "Serious", "description": "Severe injury, potential permanent harm" },
      { "id": "4", "name": "Life-threatening", "description": "Life-threatening or permanently disabling" },
      { "id": "5", "name": "Fatal", "description": "Loss of life" }
    ]
  }
}
Each enum option supports these properties:
PropertyTypeRequiredDescription
idstringYesInternal identifier stored in the work item field
namestringYesDisplay text shown in the dropdown
descriptionstringNoExtended description (visible in rating type columns)
iconstringNoIcon identifier for visual display

Configure Rating Columns for Risk Parameters

For risk assessment scales, use the ratings section instead of enums. Ratings always display descriptions in their dropdowns:
{
  "ratings": {
    "occurrence_scale": [
      { "id": "1", "name": "Remote", "description": "Failure occurrence is unlikely" },
      { "id": "2", "name": "Low", "description": "Relatively few failures" },
      { "id": "3", "name": "Moderate", "description": "Occasional failures" },
      { "id": "4", "name": "High", "description": "Repeated failures" },
      { "id": "5", "name": "Very High", "description": "Failure is almost inevitable" }
    ]
  },
  "columns": [
    {
      "id": "occ",
      "header": "Occurrence",
      "binding": "occurrence",
      "type": "rating:occurrence_scale",
      "level": 2
    }
  ]
}
For enum columns bound to Polarion custom fields, the type value must match the enum definition in Polarion’s XML custom field configuration: Standard enum custom field:
{
  "id": "riskCategory",
  "header": "Risk Category",
  "binding": "riskCategory",
  "type": "enum:risk_category"
}
WorkItem enum custom field:
{
  "id": "workpackage",
  "header": "Work Package",
  "binding": "workpackage",
  "type": "enum:@NoIDWorkItems[workpackage]"
}
The enum type identifier must match the definition in Polarion’s custom fields XML file. Open the custom field configuration in Polarion administration to find the exact enumeration name. A mismatch causes the dropdown to display raw IDs instead of human-readable labels.

Set Up Dependent Enums

Configure enum columns that cascade based on another enum’s selection using the relations array:
{
  "relations": [
    {
      "from": "riskCategory",
      "to": "riskType",
      "mapping": {
        "hardware": ["hw_wear", "hw_fatigue", "hw_corrosion"],
        "software": ["sw_logic", "sw_timing", "sw_interface"]
      }
    }
  ]
}
When the user changes the riskCategory value, the riskType dropdown automatically filters to show only the mapped options. Relationships support bidirectional propagation — changing a child value can auto-populate the parent when only one valid parent exists. For details, see Configure Dependent Enums.

Use Enum Values in Formulas

When accessing enum column values in formulas or cell decorators, Risksheet uses the enum ID (not the display name):
{
  "cellDecorators": {
    "sevHighlight": "function(info){ var val = info.value; $(info.cell).toggleClass('highSev', val === '5'); }"
  }
}
Cell decorator functions compare against enum IDs, not display values. If your enum option has "id": "yes" and "name": "Y", your decorator must compare against 'yes', not 'Y'. This is a common source of configuration errors.

Verification

After configuring your enum columns, you should now see:
  • Dropdown selectors appearing when you click an enum column cell
  • The correct option labels (not raw IDs) in the dropdown list
  • Rating columns showing both name and description for each option
  • Dependent enums filtering options when a parent value changes

See Also


KB ArticlesSupport TicketsSource Code
  • AppConfig.ts
  • RisksheetViewServlet.java
  • GetSetUtil.java
  • AppConfigHelper.ts
  • ExportToPdf.ts