Full context with Polarion services, document, and Velocity tools
risksheetPdfExport.vm
Yes
Full context plus pdfExportMacros.vm helpers
risksheet.json
Yes (since 25.4.0)
Velocity expressions evaluated during configuration parsing
Since version 25.4.0, Velocity context is available in risksheet.json. This enables dynamic configuration values using Polarion services like $repositoryService.
Use $document.customFields to read document-level custom fields in the top panel.
## Display a document custom field in the top panel<div>Product Family: $document.customFields.productFamily</div>
Use $doc.getOldApi().getValue('customFieldID') for programmatic access to custom field values.
## Access custom field via Old API#set($riskAcceptance = $doc.getOldApi().getValue("riskAcceptanceMatrix"))<script> var riskMatrix = "$riskAcceptance";</script>
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.
Access to Polarion repository operations for querying work items and documents
The complete list of Polarion services available in the Velocity context depends on your Polarion version and Risksheet configuration. Verify available services in your deployment.
## Example: Query work items using repositoryService#set($items = $repositoryService.getProjectService().getProject("myProject"))
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.
The top panel can reference external data sources via Velocity context and Polarion APIs, enabling dynamic risk matrix definitions shared across projects.
## Load risk matrix from external XML configuration#set($avasisConfig = $repositoryService.getConfigurationService().getXmlConfig("avasis"))<script> var dynamicMatrix = $avasisConfig.toJson();</script>
Since version 25.4.0, Velocity expressions in risksheet.json are evaluated during configuration loading. This enables dynamic values for project references, document fields, and conditional configuration.
The exact Velocity expressions supported in risksheet.json and their evaluation order should be verified against your Risksheet version. Not all configuration properties may support Velocity evaluation.