risksheet.json, editable through the YAML configuration editor since v25.5.0). Functions can also be registered directly on window.risksheet from a top panel Velocity template (risksheetTopPanel.vm) for cases requiring access to server-side document context. See Top Panel Template for the cross-file pattern.
Extension Points
Query Factories
Register custom query factory functions to filter which items appear in autocomplete suggestions foritemLink and multiItemLink columns. Query factories are named functions referenced by name from the typeProperties.queryFactory property on a column definition.
Query factories can be declared in two equivalent ways:
- As a named entry in the top-level
queryFactoriessection of the sheet configuration. - By assigning a function to
window.risksheet.queryFactories["<name>"]from a top panel template.
Function signature:
hazardQuery example above shows the advanced pattern: the function reads a value from the top panel via jQuery ($('#cars').val()) and returns a Lucene filter based on the user’s selection. This creates interactive filtering where the top panel UI controls which suggestions appear in autocomplete editors.
Cell Decorators
Register custom cell decorator functions for conditional visual styling of grid cells. Decorators receive aninfo object and apply or remove CSS classes to control cell appearance.
Cell decorators are defined as named entries in the cellDecorators section of the sheet configuration. A column opts in to a decorator via the cellRenderer property, which references the decorator name.
Defining in the sheet configuration:
info object):
The decorator can also dynamically control cell editability by appending field IDs to the pipe-delimited
info.item.systemReadOnlyFields string. Adding '|fieldId|' makes that cell read-only for the current row, and adding the built-in rs-readonly class gives a grayed-out visual treatment.
See Cell Decorators and Conditional Formatting for examples and the full info object reference.
Custom Context Menu Actions
Register custom actions for the grid right-click context menu. Custom actions appear alongside built-in menu items and can execute arbitrary JavaScript logic.
Action definition properties:
Registration pattern (from a top panel template):
Data Access API
risksheet.ds.getDownstreamRows(riskId)
Therisksheet.ds namespace provides client-side access to the data source backing the grid. Formulas and cell decorators can read downstream task rows linked to a given risk item using getDownstreamRows.
Usage in a formula:
- Task fields are accessed directly as object properties:
t.fieldId(e.g.,t.RCMdet,t.round). - Enum values containing a decimal point are stored with an underscore. Convert with
String(value).replace('_', '.')andparseFloat()to recover the numeric value — for example,"0_1"becomes0.1. - A formula can read another formula’s stored result for the same row via
info.item['<columnId>'].
Runtime Configuration Object
Thewindow.risksheet object exposes read-only runtime configuration values set during page initialization by the server. These values reflect the current document context, version information, and user permissions. All data shown by Risksheet is read from Polarion work items at runtime — Risksheet does not maintain a separate data store, so these values reflect the live state of the underlying Polarion document.
Environment Properties
Configuration Data
Rating scales and enumerations are NOT exposed as separate top-level properties on
window.risksheet. They are defined as Polarion enumerations in Administration > Nextedy Risksheet > Setup and referenced from column definitions via type: rating:<enumId>, type: enum:<enumId>, or type: multiEnum:<enumId>. The server loads the enum values automatically when the grid is rendered.
Controlling the Default View at Runtime
The default saved view normally comes from thedefaultView: true flag on an entry in the views section. You can also override it at runtime from a top panel script, for example to select a default view based on the current user’s role:
$securityService.getRolesForUser($securityService.getCurrentUser()) in the surrounding Velocity template, this enables role-based default views (e.g., reviewers see a “Mitigations” view, analysts see “Full Analysis”).
Formulas in the Sheet Configuration
JavaScript formulas defined in theformulas section of the sheet configuration execute in the client-side context and have access to row data through the info parameter:
Formulas are referenced by name from a column definition:
formulas section. This keeps the sheet configuration declarative and minimizes the validation scope when the calculation changes. See Top Panel Template for the bridging pattern.
See Also
- Suggestion and Autocomplete API — query factory usage in autocomplete editors
- Velocity Template Context — server-side template context variables, including
$securityService - Cell Decorators — cell decorator configuration reference
- Conditional Formatting — visual formatting rules
- Custom Renderer Templates — server-side rendering templates
- Top Panel Template — defining JavaScript functions in top panel Velocity templates
- Formula Syntax — formula function syntax and usage
- Configuration Properties Index — complete sheet configuration property reference