Skip to main content

Variable Summary

diagram

$item (ModelObject)

The primary accessor for work item data. Available for all entity types.

Example

Use $item as the primary work item accessor. It provides a higher-level API than $wi and is available for all entity types.

$wi (IWorkItem)

Legacy Polarion work item API. Only available when the entity is a work item (not for documents or other entity types).

Example

$wi is only set for work item entities. For Document or other non-work-item entity types, $wi is null. Use $item for cross-entity-type templates.

$tx (Transaction)

Current transaction object for transactional queries and read-only operations.

Example

Server-rendered templates should perform read-only operations only. Modifying data within a template evaluation can cause unexpected side effects.

$module (IModule)

The LiveDoc containing the current work item. null for entities not within a document.

Example

Always check #if($module) before accessing module properties. Entities that are not contained within a document will have $module set to null.

$context (PowersheetContext)

Powersheet-specific context providing access to project scope, document scope, and query capabilities.

Example

The exact methods available on $context depend on the Powersheet version. Consult the server logs for available context properties.

$context.parameters — reading URL query parameters

Starting with Powersheet 26.7.2, a serverRender template can read the query parameters of the sheet’s own URL through $context.parameters. Each parameter present on the URL is available under $context.parameters.<name>, keyed by the name it has in the URL:
For a sheet opened at …&testrun=v13, $context.parameters.testrun resolves to the string v13. This lets a single data model drive different server-computed values from a shareable, bookmarkable link — the same URL parameters the sheet configuration reads client-side (see URL Parameters) are also visible to server-side rendering. Worked example. A test-status column normally shows a rolling summary of a test case’s most recent runs. Passing ?testrun=<id> on the URL narrows that column to a single run, so the sheet reports each test case’s result for that specific run rather than the last few. The template reads the run from the URL and branches on it:
Because the run id lives in the URL, the narrowed view is shareable: send a colleague …&testrun=v13 and they see exactly the same slice.
Read a URL parameter with Velocity’s quiet reference form — $!context.parameters.testrun, with the ! right after the $. Plain $context.parameters.testrun renders the literal text $context.parameters.testrun into the cell whenever the parameter is absent from the URL (Velocity’s default behavior for any reference that resolves to null). The quiet form degrades to blank instead, which is what you want for an optional parameter.
$context.parameters only feeds values into a template; it does not relax the read-only contract. A serverRender script — including one driven by URL parameters — can read Polarion data but cannot modify it. Keep templates to read-only operations, as with any server-rendered property.

$pObject (IPObject)

The raw Polarion persistent object underlying the entity.

Client-Side Context Variables

In addition to server-side Velocity variables, Powersheet supports client-side $context expressions for dynamic value resolution in YAML configuration. These are resolved at configuration processing time, not during Velocity template evaluation. See JavaScript Functions for client-side expressions.

Complete YAML Example


Last modified on July 28, 2026