Skip to main content

Approach 1: Set a Uniform Value for All Resources

To change the default working hours for every resource in the project, use one of these methods:

Option A: Gantt Config Script (Per Widget)

Add the following in Widget Properties > Advanced > Gantt Config Script:
gantt.config.workingHoursPerDay=7
This sets 7 working hours per day for all resources in this specific Gantt widget.

Option B: Administration Property (Per Project or Server)

Add the following in Administration > Configuration Properties:
nextedy.gantt.workingHoursPerDay=7
This applies to all Gantt widgets in the project (or globally if set at the server level).
MethodScopeSet In
gantt.config.workingHoursPerDaySingle widgetWidget Properties > Advanced > Gantt Config Script
nextedy.gantt.workingHoursPerDayProject or serverAdministration > Configuration Properties

Approach 2: Different Hours per Resource (Script Function)

For scenarios where different users have different working hours, define a custom function in the Gantt Config Script:
gantt.config.workingHoursPerDayFunction = (resource) => {
  if (resource === "jsmith") {
    return 4;
  }
  if (resource === "mdoe") {
    return 6;
  }
  return 8;
};
This function receives the resource ID (Polarion user ID) and returns the number of working hours for that user. The Gantt uses this value when calculating capacity in the resource view.
The Gantt Config Script supports Velocity preprocessing on the server. You can use $trackerService to query work items and dynamically build the function. For example, read resource capacity from a custom work item and generate the JavaScript function body at render time.

Example: Velocity-Powered Resource Hours

gantt.config.workingHoursPerDayFunction = (resource) => {
  #set($resources = $trackerService.queryWorkItems("type:teamAssignment", "id"))
  var mapping = {
    #foreach($wi in $resources)
    "$wi.getAssignees().iterator().next().getId()": $wi.getCustomField("hoursPerDay").get(),
    #end
  };
  return mapping[resource] || 8;
};
The Velocity-based approach depends on your project’s specific work item types and custom fields. Test the generated JavaScript output in the browser console to confirm correct values.

How It Affects the Resource View

The working hours value determines the capacity denominator in resource view calculations:
  • Time mode: Shows allocated hours vs. available hours per day
  • Remaining mode: Shows remaining capacity (available minus allocated)
  • Allocation mode: Shows percentage (allocated / available * 100)
When a resource has a custom value of 4 hours per day instead of the default 8, the resource view reflects this reduced capacity. A task assigned 4 hours fills the entire day for that resource. diagram
If you also use work item calendars or CSV calendars, the per-resource working hours from those calendars take precedence over the workingHoursPerDayFunction. The script function acts as a fallback when no calendar-based hours are available for a resource.

Verify

You should now see that resource view capacity markers reflect the customized hours per resource. Resources with reduced hours show higher utilization percentages for the same amount of assigned work.

See Also

KB ArticlesSupport TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/markers.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/working-calendars/capacity-modifiers.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/Aresource-view/AganttInitialEstimation.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/working-calendars/csv-calendar.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/Aresource-view/gantt-Working-Hours.cy.ts