Skip to main content

Prerequisites

  • A Gantt widget configured with a Progress Field mapping (default: gantt_progress)
  • Edit mode access to modify widget parameters

Understand the Progress Field

The progressField widget parameter specifies which Polarion work item field stores the completion percentage. Progress values are stored as a float between 0.0 (not started) and 1.0 (complete). The Gantt chart displays this as a filled portion inside the task bar.
PropertyDefault ValueDescription
progressFieldgantt_progressWork item field storing progress (0.0-1.0)
drag_progressfalse (since v24.8.0)Enable or disable progress drag on task bars
progressColoringfalseColor-code task bars based on progress percentage
The progress system column displays the value as 0-100 in the grid, while the internal task model stores it as 0.0-1.0.
Since version 24.8.0, progress drag is disabled by default. You must explicitly enable it in the Gantt Config Script if you want users to adjust progress by dragging the task bar.

Enable Manual Progress Drag

To allow users to drag the progress indicator on task bars:
  1. Open the Polarion page containing the Gantt widget
  2. Edit the widget properties
  3. Navigate to Advanced > Gantt Config Script
  4. Add the following line:
gantt.config.drag_progress = true;
The progress drag handle is only visible when the Gantt is in Edit mode. Click the Edit button in the toolbar before attempting to drag the progress bar.

Calculate Progress from Time Estimates

For short-to-mid-term items where you want to compute progress automatically based on time tracking data, use an Item Script:
  1. Navigate to Widget Properties > Advanced > Item Script
  2. Add the following script:
var all = (wi.getRemainingEstimate() != null
            ? wi.getRemainingEstimate().getHours() : 0)
        + (wi.getTimeSpent() != null
            ? wi.getTimeSpent().getHours() : 0);
var done = (wi.getTimeSpent() != null
            ? wi.getTimeSpent().getHours() : 0);

if (wi.getResolution() != null) {
    task.progress = 1;
} else if (all == 0) {
    task.progress = 0;
} else {
    task.progress = done / all;
}

var progressString = (wi.getTimeSpent() != null ? wi.getTimeSpent() : "0h")
    + " | "
    + (wi.getRemainingEstimate() != null ? wi.getRemainingEstimate() : "0h")
    + " (" + Math.round(task.progress * 100) + " %)";
task.getFields().put("progressString", progressString);
This script computes progress as timeSpent / (remainingEstimate + timeSpent). Resolved items automatically show 100% progress.
To limit progress calculation to a specific type (for example, workpackage), wrap the script in a type check: if (wi.getType().getId() === 'workpackage') { ... }.
  1. Disable manual drag when using automatic calculation. In Advanced > Gantt Config Script, add:
gantt.config.drag_progress = false;

Show Progress Text on Task Bars

To display the calculated progress alongside the task bar, add the following to Advanced > Gantt Config Script:
gantt.templates.rightside_text = function(start, end, task) {
    return (task.progress > 0
        ? "Progress: <b>" + Math.round(task.progress * 100)
          + " % (" + task.fields.progressString + ")</b>"
        : "");
};
This renders a label to the right of each task bar showing the progress percentage and time breakdown.

Calculate Epic or Plan Progress

For parent items like epics or plans, you can compute progress as the ratio of resolved children to total children. Use this Item Script pattern for Plans Gantt:
var allitems = trackerService.queryWorkItems(
    "PLAN:(" + plan.getProjectId() + "/" + plan.getId() + ")", "id").size();
var openitems = trackerService.queryWorkItems(
    "PLAN:(" + plan.getProjectId() + "/" + plan.getId()
    + ") AND HAS_VALUE:resolution", "id").size();
if (allitems > 0) {
    task.progress = openitems / allitems;
} else {
    task.progress = 0;
}
task.getFields().put("progressString", openitems + " / " + allitems + " done");
diagram

Verify Your Configuration

After applying the scripts:
  1. Open the Gantt chart and enter Edit mode
  2. You should now see the progress bar filled proportionally inside each task bar
  3. If you enabled rightside_text, the progress percentage and time breakdown appear to the right of each task bar
  4. If you enabled drag_progress = true, hover over a task bar to see the drag handle appear on the progress boundary

See Also

KB ArticlesSupport TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/Task.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/columns/GanttSystemColumn.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/WorkItemsGanttWidget.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/GanttWidgetConfig.java
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/model/Config.java