Context Availability
Document Objects
Accessing Document Custom Fields
Use$document.customFields to read document-level custom fields in the top panel.
$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.
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.
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.Error Handling
Related Pages
- Velocity Templates for template file reference
- Top Panel Template for top panel template structure
- PDF Export Template for PDF export template structure
- PDF Export API for JavaScript export methods
- Formula Syntax for formula expressions that can call top panel functions
- Configuration Properties Index for configuration reference