Skip to main content
diagram

Context Availability

Since version 25.4.0, the Velocity context is also available in the sheet configuration. This enables dynamic configuration values driven by Polarion services such as $repositoryService.

Document Objects

Accessing Document Custom Fields

Use $document.customFields to read document-level custom fields in the top panel.
Use $doc.getOldApi().getValue('customFieldID') for programmatic access to custom field values.
The top panel can display document custom fields using Velocity but cannot currently modify them. Custom field modification requires Polarion’s standard document editing interface.

Polarion Services

$securityService — Current User and Roles

Available in risksheetTopPanel.vm. Provides identity information for role-based UI logic such as conditional rendering or per-role default views.

$testManagementService — Test Execution Records

Available in serverRender column templates. Use it to surface the latest test execution outcome next to a risk item or requirement.
The complete list of Polarion services in the Velocity context depends on your Polarion version and Risksheet release. Verify availability in your deployment.

Top Panel Context

The top panel Velocity template (risksheetTopPanel.vm) renders HTML above the Risksheet grid via the /api/panel endpoint. The template has full access to Polarion services and document context.
diagram

Bridging Top Panel Functions to Formulas

JavaScript functions defined in the top panel <script> block can be called from formulas in the sheet configuration.

Referencing External Data Sources

The top panel can reference external data sources via Velocity context and Polarion APIs, enabling dynamic risk matrix definitions shared across projects.

PDF Export Context

The PDF export Velocity template (risksheetPdfExport.vm) receives the full Velocity context plus helper macros. See PDF Export Template for template structure and PDF Export API for the JavaScript export methods.

Sheet Configuration Context

Since version 25.4.0, Velocity expressions in the sheet configuration are evaluated during configuration loading. This enables dynamic values for project references, document fields, and conditional configuration.
The exact Velocity expressions supported in the sheet configuration and their evaluation order should be verified against your Risksheet version. Not all configuration properties may support Velocity evaluation.

Error Handling

Last modified on July 10, 2026