Skip to main content
Configure the Markers Script in Widget Parameters > Advanced > Markers Script.

Script Variables

The following variables are available in the Markers Script scope:

MarkerFactory Methods

Marker Object Methods

The marker object returned by addMarker() provides these methods:
Hovering over a milestone marker displays a tooltip in the format: Milestone: <name> followed by Due Date: <YYYY-MM-DD>.

Marker Positioning

Markers render at the end of the specified date by convention. If you need a marker to appear at the start of a date, subtract one day from the date value.
By design, a marker set to "2025-08-04" renders at the end of August 4th. To position it at the start of August 4th, set the date to "2025-08-03" instead.

Manually Adding a Marker

Create a marker with explicit values:
Using the shorthand method:

Adding Markers from Plans

Pull markers automatically from Polarion plans matching a Lucene query:
  • template.id:iteration — filters plans by template ID
  • project.id:gantt2 — restricts to a specific project
Plan-based markers receive the CSS class plan, enabling distinct visual styling.

Adding Markers from Work Items

Pull markers from Polarion work items matching a Lucene query:
  • type:release — filters work items by type
  • "publicLaunch" — the date field on the work item used to position the marker
  • "blue" — the marker color

Dynamic Project ID

Use config.getContextProjectId() to reference the current project instead of hardcoding:

Dynamic Markers with Polarion API

Use trackerService for full scripting control over marker creation. This approach supports filtering, conditional coloring, and custom tooltip content.

Loading Time Points

Since Polarion version 2304, use getter methods instead of direct property access. Use tp.getName() instead of tp.name. Use tp.getTime().getDate() instead of tp.time.date.

Polarion 22 R2 and Older

For older Polarion versions, use direct property access:

Dynamic Marker Customization with Page Parameters

Combine trackerService with page parameters to let users control which markers appear:

Marker CSS Classes

diagram

Error Handling

  • Script errors display as a warning indicator with a count badge in the Gantt toolbar
  • The error message includes the prefix Markers Script Error:
  • Errors appear in both view mode and wiki editor mode

Configuration Example

A complete Markers Script combining plan markers, work item markers, and a manual milestone:
Last modified on July 10, 2026