What Item Scripts Do
Item scripts run against each card as the board renders. They let you express per-card logic that goes beyond static widget parameters — for example, highlighting cards based on field combinations, computing derived labels, or conditionally hiding cards that match a specific state.Item scripts operate at the card level. For board-wide configuration logic (selecting Plans, adjusting swimlane rules, or loading alternate data sets), see Config Scripts and Data Scripts instead.
Prerequisites
Before writing an item script:- The Planningboard widget must already be embedded in a Polarion LiveDoc or Wiki page.
- You must have edit access to the page containing the widget.
- Confirm the widget parameter that accepts the script is available in your installed version.
How Item Scripts Are Applied
The board evaluates the item script once per card, passing the work item as the script’s input context. The script can return values that modify how the card is displayed — for example, a CSS class name or a computed label.1
Open the Widget Parameter Editor
- Navigate to the LiveDoc or Wiki page containing the Planningboard widget.
- Switch the page to Edit mode.
- Click the widget to select it, then open its parameter editor (the gear or edit icon shown in the widget toolbar).
2
Locate the Script Parameter
In the widget parameter editor, look for the parameter that accepts JavaScript expressions or script content for item-level logic.
3
Write the Item Script
Item scripts are written as JavaScript expressions. The work item is available as a context object. Access its fields using the field IDs defined in your Polarion project.Example — apply a CSS class based on priority:Example — flag items planned past their due date:
4
Reference the Returned Value
The value your script returns is applied to the card. How it is used depends on what the script parameter controls:
5
Save and Verify
- Save the widget parameter editor.
- Save the page.
- Reload the board.
Common Pitfalls
Configuration Example
The following shows a complete item script parameter scenario: a board scoped to a project’s stories, where cards inOpen status that have no assignee should be visually flagged.
unassigned-open class.
Verification
After saving the widget and reloading the board:- Cards matching your condition should render with the visual change your script produces (class applied, label shown, or card hidden).
- Cards not matching the condition should render exactly as before.
- Open the browser developer console — there should be no JavaScript errors related to the item script.
See Also
- Config Scripts — board-level scripted configuration
- Data Scripts — scripted data loading and transformation
- Template Functions — reusable functions for card templates
- Highlight Work Items by Rules — rule-based highlighting without scripting
- Customize Card Appearance — static card appearance options
- Script Errors — diagnosing and resolving script issues
- Widget Parameters Overview — full list of configurable widget parameters
Sources
Sources
KB Articles
- Planningboard: Customizable Statistics and Capacity Indicators
- Planningboard Widget Parameters
Config.javaviewSetup.vmPlanningBoardWidgetRenderer.javaPlanningBoardDataService.javaPlanningBoardWidget.java