Skip to main content

What you will achieve

By the end of this tutorial, you will understand the risksheet.json configuration file structure, know how to locate and open it, add a new column, define a formula for Risk Priority Number (RPN) calculation, and apply conditional formatting to highlight risk levels with color coding.

Prerequisites

Risksheet ships with a demo project configuration based on the DrivePilot template. The demo includes pre-configured risk item types, rating scales, and column layouts. This tutorial builds on the demo configuration as a starting point, but the steps apply to any project.

Step 1: Locate the Configuration File

The Risksheet configuration is stored in a file named risksheet.json attached to your Polarion LiveDoc document. Open your Risksheet document in the browser. Click the ⚙️ Configure button in the toolbar to open the configuration editor. You should see the configuration editor interface in a new browser window, showing the current JSON configuration for your document.
The configuration editor opens at the URL pattern {baseUrl}/risksheet/configuration/ with query parameters for your project and document. You can also navigate directly to this URL.

Step 2: Understand the Configuration Structure

The risksheet.json file is organized into top-level sections. Here is the basic structure with the most important sections:
{
  "dataTypes": {
    "risk": { "type": "risk" },
    "task": { "type": "mitigationAction", "role": "mitigates" }
  },
  "levels": [ {}, {} ],
  "columns": [],
  "formulas": {},
  "ratings": {},
  "enums": {},
  "cellDecorators": {},
  "styles": {},
  "global": { "culture": "en" },
  "reviews": { "reviewManager": "CommentBased" }
}
SectionPurpose
dataTypesDefines the Polarion work item types for risk items and tasks
levelsConfigures the hierarchical row structure (failure mode, cause, effect)
columnsDefines every column in the grid — bindings, types, headers, widths
formulasNamed JavaScript functions for calculated columns (e.g., RPN)
ratingsRating scale definitions for severity, occurrence, detection dropdowns
enumsEnumeration option definitions for dropdown columns
cellDecoratorsConditional formatting functions that apply CSS classes to cells
stylesCSS class definitions used by cell decorators
globalGlobal settings like culture/locale
reviewsReview workflow configuration

Step 3: Add a Column

Add a new column to display the “Effect of Failure” for each risk item. In the columns array, add the following entry:
{
  "id": "effect",
  "binding": "effect",
  "header": "Effect of Failure",
  "type": "text",
  "width": 200,
  "level": 2
}
PropertyValueExplanation
id"effect"Unique identifier for this column
binding"effect"Maps to the effect custom field on Polarion work items
header"Effect of Failure"Text displayed in the column header
type"text"Plain text data type
width200Column width in pixels
level2Appears at the second hierarchical level (cause/effect level)
After saving, you should see the new “Effect of Failure” column in the grid at the position matching its order in the columns array.
The binding value must match an existing custom field ID in your Polarion project. If the field does not exist, the column will display empty values. Create the custom field in Polarion administration first, then reference it in your column binding.

Step 4: Define Rating Scales

Rating columns need scale definitions so users see meaningful dropdown options instead of raw numbers. Add severity and occurrence scales to the ratings section:
{
  "ratings": {
    "severity": [
      { "id": "1", "name": "Negligible", "description": "No injury or minimal impact" },
      { "id": "2", "name": "Minor", "description": "Light injury, first aid treatment" },
      { "id": "3", "name": "Moderate", "description": "Moderate injury, medical treatment" },
      { "id": "4", "name": "Significant", "description": "Severe injury, hospitalization" },
      { "id": "5", "name": "Catastrophic", "description": "Life-threatening or fatal" }
    ],
    "occurrence": [
      { "id": "1", "name": "Remote", "description": "Once in 10+ years" },
      { "id": "2", "name": "Low", "description": "Once in 5-10 years" },
      { "id": "3", "name": "Moderate", "description": "Once in 1-5 years" },
      { "id": "4", "name": "High", "description": "Once per year" },
      { "id": "5", "name": "Very High", "description": "Multiple times per year" }
    ],
    "detection": [
      { "id": "1", "name": "Almost Certain", "description": "Controls will detect" },
      { "id": "2", "name": "High", "description": "High chance of detection" },
      { "id": "3", "name": "Moderate", "description": "Moderate chance" },
      { "id": "4", "name": "Low", "description": "Low chance of detection" },
      { "id": "5", "name": "Undetectable", "description": "No detection method" }
    ]
  }
}
Then reference these scales in your rating columns:
{
  "id": "sev",
  "binding": "sev",
  "header": "Severity (S)",
  "type": "rating:severity",
  "width": 80,
  "level": 2
}
You should see a dropdown in the Severity column showing options like “1 - Negligible”, “2 - Minor”, etc.

Step 5: Add a Calculated RPN Column

The Risk Priority Number (RPN) is calculated by multiplying Severity, Occurrence, and Detection values. Define the formula in the formulas section and reference it from a column. Add the formula:
{
  "formulas": {
    "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value?value:null;}"
  }
}
Add the RPN column referencing this formula:
{
  "id": "rpn",
  "binding": "rpn",
  "header": "RPN",
  "type": "int",
  "width": 70,
  "formula": "commonRpn",
  "level": 2
}
You should see the RPN column automatically calculating values when severity, occurrence, and detection are filled in. The column is automatically read-only because it has a formula property set.
The info parameter provides info.item — an object with the current row’s field values keyed by column id. Access any column value with info.item['columnId']. Return null for empty/invalid results to display a blank cell.

Step 6: Apply Conditional Formatting

Color-code the RPN column to visually indicate risk levels. This requires two pieces: a cellDecorators function that applies CSS classes, and styles definitions for those classes. Add the cell decorator:
{
  "cellDecorators": {
    "rpn": "function(info){ var val = info.value; $(info.cell).toggleClass('boldCol', true); $(info.cell).toggleClass('rpn1', val>0 && val<=150); $(info.cell).toggleClass('rpn2', val>150 && val<=350); $(info.cell).toggleClass('rpn3', val>350);}"
  }
}
Add the CSS style definitions:
{
  "styles": {
    ".boldCol": { "font-weight": "600" },
    ".rpn1": {
      "background-color": "#eaf5e9 !important",
      "color": "#1d5f20 !important"
    },
    ".rpn2": {
      "background-color": "#fff3d2 !important",
      "color": "#735602 !important"
    },
    ".rpn3": {
      "background-color": "#f8eae7 !important",
      "color": "#ab1c00 !important"
    }
  }
}
You should see the RPN cells color-coded:
RPN RangeColorCSS ClassMeaning
1 — 150Greenrpn1Low risk
151 — 350Yellowrpn2Medium risk
351+Redrpn3High risk

Step 7: Save and Verify

Save the configuration in the configuration editor. The Risksheet grid reloads with your changes applied. Verify the following:
  1. The new “Effect of Failure” column appears in the grid
  2. Severity and Occurrence columns show dropdown selectors with your scale values
  3. The RPN column calculates automatically when S, O, and D values are entered
  4. RPN cells are color-coded based on the calculated value
If the grid fails to load after saving, check the browser console for error messages. Common issues include: missing commas in JSON, unmatched brackets, invalid formula syntax, or column binding values that do not match Polarion field names. The error "Error while reading configuration" indicates a JSON parsing failure.
Configuration Workflow
Edit risksheet.json—>Save in config—>Grid reloads
in config editoreditorwith changes
JSON syntax validationServer-sideClient-side
(brackets, commas)type inferenceformula eval
v v v
Fix JSON errorsDefaults appliedDecorators apply
if anyfor missing propsstyles to cells

Next Steps

You now have a working Risksheet configuration with columns, formulas, and conditional formatting. Continue with these resources:
  • Quick Start Guide — complete end-to-end risk analysis walkthrough
  • How-To Guides — task-oriented guides for advanced configuration
  • Reference — complete property reference, formula functions, and API documentation
  • FAQ — common questions and answers
Support TicketsSource Code
  • RisksheetViewServlet.java
  • AppConfig.ts
  • CommandFactory.ts