Skip to main content
This page has limited source coverage. Variable availability and behavior should be verified against your Polarion version.

Velocity Pre-processing Flow

diagram
Velocity expressions use the $variable syntax. The Velocity engine replaces these with actual values from the Polarion server context before any script logic runs.

Available Context Variables

Additional Velocity context variables may be registered by Polarion extensions. The variables listed above are confirmed from the Gantt extension configuration. Check your Polarion instance for the complete set of available Velocity context objects.

Usage in Item Script

Velocity expressions in the Item Script are resolved on the server before the script executes per work item. Use Velocity to inject server-side data into your script logic:

Usage in Gantt Config Script

Velocity expressions in the Gantt Config Script are resolved on the server before the script is sent to the client browser:

Usage in Markers Script

Velocity expressions in the Markers Script are resolved before marker creation logic runs:

Common Patterns

Dynamic Project ID

Avoid hardcoding project IDs by using Velocity:

User-Specific Behavior

Customize Gantt behavior based on the current user:

Conditional Script Sections

Use Velocity directives to include or exclude entire script blocks:
Velocity expressions ($variable, #if, #foreach) are processed on the server and produce plain text output. JavaScript logic (if, for, var) executes afterward. Do not confuse the two — Velocity runs first and generates the JavaScript that will run.

Escaping

The Velocity-resolved script output is escaped for safe embedding in the page. Backslashes, single quotes, and newlines are automatically handled. You do not need to manually escape these characters in your Velocity expressions.

Configuration Example

A complete Item Script combining Velocity context with JavaScript logic:
Last modified on July 10, 2026