Skip to main content

When to Use This Approach

Use plan-derived scheduling when work items do not have their own start/end date fields populated but are assigned to Polarion Plans (iterations, releases) that have defined date ranges. This is common in agile workflows where sprints and iterations define the schedule.
Gantt chart showing a user story whose schedule is derived from its assignment to a Polarion Plan instead of from date fields
User story PCP-43 assigned to Iteration 34, with its Gantt schedule taken from that sprint assignment
1

Add the Item Script

Navigate to Widget Properties > Advanced > Item Script and add one of the following scripts depending on your scenario.

Option A: Derive Schedule for All Unplanned Items

Use the built-in utility method to automatically assign plan dates to unplanned work items:
Replace "iteration" with the plan template ID that matches your project (e.g., "release", "sprint").
Unplanned Work Package 'The Primary Flight Displays' shown on the Gantt chart before its schedule is derived
The Work Package planned in Iteration 39, which ends on 10.10.2023
Polarion Plan view confirming Iteration 39 and its end date used as the source for the derived schedule

Option B: Derive Schedule for a Specific Plan Type

For more control, iterate through the work item’s plan assignments and match a specific template:
Always wrap your Item Script with if (wi != null) to prevent errors when the script processes synthetic or missing work items. Without this check, the script may fail silently.
Set the derived dates with task.start_date and task.end_date (property assignment, as shown above) — this is the documented form (see the Item Script API). Do not assign to task.setStart_date / task.setEnd_date: those are setter methods, not assignment targets, so assigning a value to them does not set the date. For the Polarion 2304+ scripting changes (getter methods and typeof checks), see Migrate Scripts for Polarion 2304+.
2

Configure the Plans Gantt View (Optional)

If you want to display both plans and work items together on a single Gantt chart, use the Plans Gantt widget:
  1. Set Widget Properties > Show Plan Work Item > Enable Show Items to true.
  2. Configure the Load Children depth to control how many levels of sub-plans and work items are displayed.
  3. Set the child link role to load work items under their parent plans.
For portfolio-level visibility, configure the Plans Gantt with Release as the top-level plan template, Iteration as the second level, and work items as the third level. Set Load Children to 3 to display the full hierarchy.
3

Save and Reload

Save the widget properties and reload the page. The Gantt chart recalculates work item positions based on their plan assignments.

Verification

You should now see:
  • Previously unplanned work items now positioned on the Gantt chart at the dates of their assigned plans
  • Derived items marked as read-only (not draggable) if you set task.readonly = true
  • Plan date ranges reflected accurately on the work item task bars
The previously unplanned Work Package now scheduled on the Gantt chart with dates inherited from its assigned Iteration 39 plan

See Also

Last modified on July 10, 2026