What is a config script?
A config script is a JavaScript snippet you supply via theadvScript widget parameter. The script runs in the Planningboard widget context and has access to the board configuration object before the board renders. This allows you to manipulate configuration values that are not exposed directly in the widget parameter editor, or to set them conditionally based on runtime context.
Config scripts execute client-side, in the Planningboard widget frame. They are not server-side scripts. Changes you make affect the current board session only — they do not persist to the widget parameter store.
When to use config scripts
Config scripts are suited for:- Overriding a configuration property that cannot be set through the standard widget parameters UI
- Applying conditional logic (for example: show different capacity settings for different teams)
- Injecting dynamic values that depend on page context or URL parameters
How config scripts are loaded
TheadvScript widget parameter value is passed into the board widget and exposed as window.__pbAdvScript. The Planningboard scheduler reads this property during initialization and evaluates it after the initial configuration object is assembled but before the board renders.
Step-by-step: adding a config script
1. Open the widget parameter editor
Navigate to the Polarion LiveDoc or Wiki page that hosts the Planningboard widget. Switch to edit mode and open the widget parameters panel.2. Locate the Advanced Script parameter
In the widget parameters editor, find the field labelled Advanced Script (mapped to theadvScript parameter). This is a free-text field that accepts JavaScript.
3. Write your script
Your script runs in the widget frame’s JavaScript context. The Planningboard configuration object is accessible aswindow.__pbConfig. Modify properties on this object directly.
Example: override the maximum number of work items
4. Save the widget parameters
Save the widget configuration. Reload the Planningboard page to verify the script takes effect.Configuration properties available in window.__pbConfig
The following properties are confirmed present in the configuration object. Use their exact names — incorrect casing or spelling will produce no effect (the property will be ignored silently).
Common pitfalls
Script does not run
Check the browser console for JavaScript syntax errors. A missing semicolon or unmatched bracket prevents the entire script from executing. Also confirm the script is saved in theadvScript parameter, not in a different parameter field.
Property change has no visible effect
Some properties are consumed during an initialization phase that has already passed by the time the script runs. If a property change does not take effect, the property may not be modifiable via config script — consult the Widget Parameters Overview for the canonical way to set that value.Board shows wrong capacity after script change
Capacity configuration involves several interacting properties (capacityLoad, multiCapacityLoad, userCapacityLoad, hoursPerDay, capacityField). Setting one without the others may produce unexpected results. See Configure Capacity Tracking for the full configuration sequence.
Script conflicts with page parameters
If you are also using Use Page Parameters or Scripted Page Parameters, be aware that page parameters are resolved server-side before the board widget is rendered, while the config script runs client-side. The config script runs after page parameter substitution, so it can read but not undo parameter-derived values.Verification
After saving your config script and reloading the board, you should see the board render with the modified behaviour. To confirm the script ran:- Open browser developer tools (F12).
- In the Console, type
window.__pbConfigand press Enter. - Inspect the configuration object — the properties you modified should reflect the values set in your script.
See also
- Widget Parameters Overview — all standard widget parameters and their defaults
- Item Scripts — scripts that run per work-item card, for dynamic card content
- Data Scripts — scripts for transforming the work item dataset before the board renders
- Scripted Page Parameters — server-side parameter scripting complementary to config scripts
- Dynamic Filtering with Page Parameters — using URL parameters to drive board configuration
- Script Errors — diagnosing and resolving script execution errors