Script Variables
The following variables are available in the Item Script scope:Task Object Properties
Thetask object represents a Gantt chart task. You can read and modify these properties:
Custom Fields Map
Pass additional data to the client usingtask.getFields():
Color Logic
There are two color properties with different behavior:Color by Assignee Example
Color by Type and Status Example
Progress Calculation
Compute progress from time estimates:Milestone Configuration
Set a task to render as a milestone diamond:Schedule Derivation from Plans
Derive a task’s schedule from its Polarion plan assignment:Baseline Comparison
Set custom baseline values for schedule comparison:Passing Data to Right-Side Text
Prepare data in the Item Script, then render it in the Gantt Config Script: Item Script:Script Execution Flow
Error Handling
- Script errors display as a warning indicator in the Gantt chart toolbar
- The error message includes the prefix Item Script Error:
- Add null checks before accessing work item properties:
if (wi != null) { ... } - On Polarion 2304+, use
typeof wi !== 'undefined'for existence checks
Configuration Example
A complete Item Script combining progress calculation, color logic, and right-side text:Related Pages
- Gantt Config Script API — client-side script for templates and events
- Velocity Context Variables — server-side variables available in script pre-processing
- Item Color Legend — default color behavior and how scripts override it
- Page Parameters API — access user-input parameters in scripts
- Marker Factory API — add milestone markers from scripts