Skip to main content
Server-rendered properties let you compute read-only column values that depend on data outside the current work item — related items, project metadata, repository information, or the current user’s permissions. Configure them via the serverRender key in the data model YAML and display them in sheet columns marked as read-only.

Service Injection Architecture

diagram
The server renderer populates two layers of Velocity context: The static context is built once and stored in a cached base context object. All platform service references are then reused across every template evaluation without re-initialization, which keeps rendering fast even for large sheets.

Service Summary


$trackerService

Provides access to work item queries, project-level tracker metadata, and Lucene search operations. This is the most commonly used platform service in server-rendered properties because it enables cross-item lookups and data aggregation across the project.

Common Operations

Example: Retrieve a Work Item by URI

Example: Run a Lucene Query

Example: Access Project Metadata

Example: Count Linked Design Requirements

This pattern queries for all design requirements linked to the current work item:
Lucene queries inside serverRender execute once per row in the sheet. On a sheet with 500 work items, a single Lucene query in a server-rendered column runs 500 times. Keep queries simple and avoid them on large datasets. Test on a filtered subset first.

$txService

Provides access to Polarion transaction management. In the context of server-rendered properties, templates execute within a read-only evaluation context. The transaction service is primarily useful for understanding the execution context rather than performing write operations.
The $txService variable is available in all templates. Its available methods depend on the Polarion server version. Consult the Polarion API documentation for the ITransactionService interface. Server-rendered expressions should not use this service to initiate write transactions — they run in a read-only evaluation context.

$repositoryService

Provides access to repository-level operations: project metadata, user information, roles, and repository configuration. Useful for templates that need to display data from outside the current work item’s project scope or that need to resolve user or role information.

Example: Access Project Name

Example: Resolve a User ID to Display Name

Available methods depend on the Polarion server version. The repository service provides read-only access to repository-level resources. Consult the Polarion API documentation for IRepositoryService.

$securityService

Enables permission checking, role-based visibility, and user identification within templates. Use this service to conditionally render content based on the logged-in user’s identity or to verify access rights before displaying sensitive data.

Example: Show Current User

Example: Permission-Based Visibility

Example: Role-Based Content

Combine $securityService with conditional Velocity logic to build columns that display different content depending on the current user’s role or permissions. The rendered value is computed server-side, so the user cannot bypass the check client-side.

Per-Item Context Variables

In addition to the static platform services, the server renderer injects per-item variables for each work item during evaluation. These are documented in detail on the Context Variables page. The summary:
Prefer $item (ModelObject) for accessing standard work item properties. Use $wi (IWorkItem) only when you need methods not available on $item, such as getCustomField() or getLinkedWorkItems(). The $wi variable is only set for work item entities — it is null for non-work-item entity types.

Caching Behavior


Error Handling

When a Velocity template evaluation fails, the server renderer returns the constant error marker:
If this value appears in a sheet column, the serverRender expression for that property contains an error. Check the Polarion server logs for one of these exceptions:
The #SERVER_RENDER_ERROR marker is the only client-visible indicator of a problem. To diagnose the root cause, check the Polarion server logs (logs/polarion*.log) where the full stack trace is logged with the template pattern and exception details. Common causes include referencing a null property without an #if guard, calling a method with the wrong argument type, or using incorrect Velocity syntax.

Data Model Configuration

Server-rendered properties are configured in the data model YAML using the serverRender key on a property definition. The value is an Apache Velocity template that is evaluated for each work item when the sheet loads.

Property Definition

Properties with serverRender are automatically marked as read-only — the computed value cannot be edited by users.

Single-Line Expression

Multi-Line Template

Use YAML block scalar syntax (|) for templates with conditional logic or multiple statements:

Complete YAML Example

The following data model and sheet configuration demonstrate all four platform services used in server-rendered properties within a standard RTM entity type. Data model YAML:
Sheet configuration YAML:
Server-rendered properties are always read-only in the sheet. The serverRender value is computed on each query and cannot be edited by the user. Mark the corresponding sheet columns with isReadOnly: true to communicate this in the UI.

Best Practices


Service Availability Quick Reference

Use the following decision table to determine which service fits your use case:

Last modified on July 10, 2026