Skip to main content

Prerequisites

  • A data model with a server-rendered property (see Create a Computed Property)
  • Basic understanding of Apache Velocity template syntax
1

Access Work Item Properties via $item

The $item variable provides access to the work item model object. Use it to read standard and custom field values:
Example serverRender expression that combines fields:
2

Use Conditional Logic

Velocity supports #if, #elseif, #else, and #end directives for conditional rendering:
3

Access Document Context via $module

When a work item belongs to a LiveDoc, the $module variable provides document-level properties:
If the entity is not associated with a document, $module will be null. Always add a null check: #if($module)$module.moduleName#else N/A#end
4

Use the Low-Level Work Item API via $wi

The $wi variable exposes the Polarion work item API for operations not available on $item:
The $wi variable is only available for work item entities. For other entity types (documents, chapters), use $item or $module instead.
5

Use Platform Services

Server-rendered templates have access to several Polarion platform services:
Available service variables:See Access Polarion Services for detailed examples of each service.
6

Handle Errors Gracefully

When a Velocity template fails, Powersheet returns the error marker #SERVER_RENDER_ERROR in the cell. Protect against common failures with defensive coding:
If you see #SERVER_RENDER_ERROR in a column cell, the template failed due to a parse error, method invocation error, or missing resource. Check the Polarion server logs for the specific exception type.

Template Patterns Reference

String concatenation:
Null-safe access:
Collection iteration:
Variable assignment:
The available methods on $item, $wi, and platform services depend on your Polarion version. Test templates with simple expressions before building complex logic.

Verify

After configuring a Velocity template expression:
  1. Open the powersheet document in Polarion
  2. You should now see computed values in the server-rendered column
  3. Verify that null-safe checks work by testing with work items that have empty fields
  4. If values show #SERVER_RENDER_ERROR, consult the Debug Template Errors guide

See Also

Last modified on July 10, 2026