Configure severity, occurrence, and detection rating scales with RPN formulas and conditional cell formatting to implement risk evaluation matrices in Risksheet.
Define formulas that calculate the Risk Priority Number from your rating values. The standard FMEA formula multiplies severity, occurrence, and detection:
{ "formulas": { "commonRpn": "function(info){ var value = info.item['occ']*info.item['det']*info.item['sev']; return value ? value : null; }", "commonRpnNew": "function(info){ var value = info.item['occNew']*info.item['detNew']*info.item['sevNew']; return value ? value : null; }" }}
commonRpn calculates the initial RPN before mitigation (S x O x D)
commonRpnNew calculates the revised RPN after mitigation actions are applied
For probability/severity matrices (without detection), implement a riskValue function that maps severity and probability combinations to risk categories such as acceptable, further investigation, or unacceptable. See Set Up Action Priority Matrix for this approach.
Use cellDecorators and styles to color-code cells based on RPN thresholds:
{ "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); }" }, "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; }" }}
This creates a three-tier visual risk matrix:
RPN Range
CSS Class
Color
Risk Level
1 — 150
.rpn1
Green
Low
151 — 350
.rpn2
Yellow
Medium
> 350
.rpn3
Red
High
When configuring severity from a linked item (e.g., Accident or Harm), verify that the formula references the correct field binding. The formula accesses info.item['fieldBinding'] — if the severity value comes from a different work item type in the hierarchy, adjust the binding path accordingly.
Apply the risk level to row headers for at-a-glance assessment using the headers.rowHeader.renderer property:
{ "headers": { "rowHeader": { "renderer": "rowHeaderRpnNew" } }, "cellDecorators": { "rowHeaderRpnNew": "function(info){ var val = info.item['rpnNew']; $(info.cell).toggleClass('rpn1', val > 0 && val <= 150); $(info.cell).toggleClass('rpn2', val > 0 && val > 150 && val <= 350); $(info.cell).toggleClass('rpn3', val > 0 && val > 350); }" }}
This colors the row header based on the post-mitigation RPN (rpnNew), giving engineers instant visibility into which risk items still require attention.
The risksheetTopPanel can reference external data sources via Velocity context and Polarion APIs, enabling dynamic risk matrix definitions shared across projects without duplicating formula logic in each risksheet.json.
You should now see rating dropdowns with descriptions for severity, occurrence, and detection. The RPN column should automatically calculate when all three ratings are entered. Cells should display green, yellow, or red formatting based on the RPN thresholds. Row headers should reflect the post-mitigation risk level.