Skip to main content
diagram
Most extension points are populated from the sheet configuration file (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 for itemLink 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:
  1. As a named entry in the top-level queryFactories section of the sheet configuration.
  2. By assigning a function to window.risksheet.queryFactories["<name>"] from a top panel template.
Function signature:
Declaring in the sheet configuration:
Referencing from a column:
The 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.
If your query factory determines that no additional filtering is needed for the current context, return an empty string "" rather than null or undefined. Empty strings are safely ignored by the query builder.

Cell Decorators

Register custom cell decorator functions for conditional visual styling of grid cells. Decorators receive an info 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:
Function parameters (the info object):
Cells in the grid are reused as the user scrolls. Setting inline styles (info.cell.style.background = ...) leaves stale styling on cells when they are reused for different rows. Always use $(info.cell).toggleClass('className', condition) so styling is correctly applied or removed for each value. Row header decorators use the same $(info.cell).toggleClass('className', condition) form.
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):
The execute field is the name of a function registered on the global window object, as a string. The enabled field is an inline function (not a name) evaluated against the current selection. Functions defined in closures or module scopes cannot be referenced by name from execute.

Data Access API

risksheet.ds.getDownstreamRows(riskId)

The risksheet.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:
Key patterns:
  • 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('_', '.') and parseFloat() to recover the numeric value — for example, "0_1" becomes 0.1.
  • A formula can read another formula’s stored result for the same row via info.item['<columnId>'].
This API is the recommended way to aggregate or compute values from downstream tasks (such as residual risk after mitigations) without falling back to server-side rendering.

Runtime Configuration Object

The window.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 the defaultView: 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:
When combined with $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 the formulas 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:
For complex calculations (multi-step risk matrices, conditional logic that spans many fields), define a JavaScript helper function in the top panel template and call it from a thin wrapper in the 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

Last modified on July 10, 2026