Skip to main content

Prerequisites

  • A working Nextedy GANTT widget with Plans configured
  • Work items assigned to Polarion Plans (iterations, releases)
  • Access to Widget Parameters > Advanced > Item Script

Option 1: Derive Schedule from Plans Using Item Script

When you need a work item’s dates to come from its plan assignment rather than from its own date fields, add the following to Widget Parameters > Advanced > Item Script:
This script iterates through all plans the work item belongs to, finds the one matching the Iteration template, and copies the plan’s start and due dates onto the task bar.

Option 2: Use the Utility Method for Unplanned Items

For work items that have no dates set, use the built-in deriveScheduleFromPlans utility method in your item script:
This method automatically sets the task’s start and end dates from the matching plan.
Null check for work itemsIf you encounter errors during script execution, the script may be processing a non-existent work item. Add a null check around your script:

Option 3: Automatic Sync with syncToPlans

When you save a work item in the Gantt, it can be planned automatically into the Polarion plans that cover its dates. Use this when an item that slips should move into the next iteration, or an item that spans several iterations should be planned into all of them. Before you start
  • You can edit the widget parameters of the Gantt page.
  • The plans exist in the same project as the work items, and have a start date and a due date.

Turn On Sync to Plans

1

Open the work item type configuration

Edit the Gantt page, select the Nextedy GANTT widget, and open Widget Parameters > Work Item Types Configuration.
2

Select the work item type

Open the entry for the work item type whose schedule should drive plan assignment, for example Work Package.
3

Choose the plan template

Next to Sync to Plans, click Select… and choose one or more plan templates of the project, for example Iteration.
4

Save the page

Save the page. Parameter changes that are not saved are lost when the page reloads.
The Gantt also shows a marker at the due date of each plan of the selected templates.

What Happens When You Save a Task

When you save a task of that type in the Gantt, its Planned In list is updated for plans of the selected templates:
  • The item is added to every plan of those templates, in the work item’s project, whose start and due dates overlap the task’s start and end dates.
  • The item is removed from plans of those templates that no longer overlap.
  • Plans of other templates are not changed.
For example, a task that spans only Iteration 34 is planned in Iteration 34. If you drag it later so it sits inside Iteration 35, saving moves it to Iteration 35. If you stretch it across both, it is planned in both.

Match Plans by a Custom Field

If several plans cover the same dates, for example one per department, date overlap alone puts the item in all of them. To restrict the match to plans that carry the same value in a custom field, configure context matching. This is available in version 24.1.3 and later.
Gantt with two plans, Iteration 56 Customer Service and Iteration 55 Marketing. The work item WI Marketing, whose department is marketing, is planned only in Iteration 55 Marketing.
Sync to Plans must already be turned on for the work item type, as described above.
1

Create the enumeration

In Administration > Work Items > Enumerations, create an enumeration with the values you want to match on, for example marketing and customerservice.
Enumeration department-enum.xml with the values marketing and customerservice
2

Add an identical custom field to work items and plans

Add an enumeration custom field with the same field ID and the same enumeration to both Custom Fields (work items) and Plan Custom Fields. For example, a field department that uses the enumeration from the previous step.
3

Set the same value on the work item and the plan

Set department to the same value on the work item and on the plan, for example customerservice on both.
Work item WI Customer Service with department set to customerservice and Planned In empty
Plan Iteration 56 Customer Service with the custom field department set to customerservice
4

Set the context field property

In the project’s Administration > Configuration Properties, add the following property, where department is the ID of the custom field you created:
You need administration rights for the project to set this property.
After this, saving a task links the work item only to overlapping plans whose department value matches the work item’s. It is removed from plans of the selected templates whose value does not match.
After WI Customer Service is moved to overlap Iteration 56 Customer Service and saved, its Planned In shows Iteration 56 Customer Service
Work items without a value are not syncedWhen the property is set, saving a work item whose context field is empty leaves its Planned In list unchanged: it is neither added to nor removed from any plan. Fill in the field on every work item that should be synced. The field must be an enumeration field; a value of any other field type is treated as empty.
The three options side by side:
Plan limitsFor each saved task, up to 100 overlapping plans are matched. Plan markers show up to 100 plans of the selected templates. Before version 25.8.0, markers for newer plans could be missing when the project has more than 100 such plans; from 25.8.0 the plans with the most recent due dates are shown.

Verify

After configuring one of the above methods, reload the Gantt chart. You should now see work items positioned on the timeline according to their assigned plan dates. Unplanned items should display at their plan’s date range, and items with syncToPlans enabled should automatically update plan membership when you drag and save them.

See also