Skip to main content

Where to Add Marker Scripts

Open your Gantt widget parameters, expand the Advanced section, and locate the Markers Script field. All marker scripts go here. The script has access to markerFactory, trackerService, and config objects.

Marker Factory API

The markerFactory object provides these methods: The marker object returned by addMarker() has these setter methods:

Add a Manual Marker

Create a fixed marker at a specific date:
This adds a green vertical line labeled “20.0” at August 4, 2025.

Add Markers from Plans

Automatically generate markers from Polarion plan boundaries (iterations, sprints):
For the current project, use config.getContextProjectId() instead of a hardcoded project ID:

Add Markers from Work Items

Generate markers from work items of a specific type using a date field:
The second parameter ("publicLaunch") specifies which date field on the work item provides the marker date.

Use Polarion API for Dynamic Markers

For full scripting control, use trackerService to query work items and create markers programmatically. This example loads Polarion project time points:
On Polarion 2304 and later, use tp.getName() and tp.getTime().getDate() instead of tp.name and tp.time.date. See Migrate Scripts for Polarion 2304+.

Filter Markers with Page Parameters

Use page parameters to let users control which markers appear. This example reads a milestone page parameter and renders matching work items as markers:
Markers render at the end of the specified date. If you need a marker at the start of a day, subtract one day from the date value in your script.

Marker Styling

Markers automatically receive CSS classes based on their source: Hovering over a marker displays a tooltip showing the marker name and due date.

Handle Script Errors

If the Markers Script contains errors, the Gantt chart displays a warning indicator in the footer with the prefix Markers Script Error:. Check the browser console for details. See Debug Script Errors for systematic debugging.

Verify Your Changes

Save the page and reload the Gantt chart. You should now see vertical marker lines on the timeline at the specified dates, with labels and colors matching your script configuration. Hover over markers to confirm tooltip text displays correctly.

See Also

Last modified on July 10, 2026