Skip to main content

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.
This per-card evaluation means item scripts must be efficient — they run for every card in the visible board, not once globally.
1

Open the Widget Parameter Editor

  1. Navigate to the LiveDoc or Wiki page containing the Planningboard widget.
  2. Switch the page to Edit mode.
  3. 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.
Widget parameter names are case-sensitive. Use the exact parameter name as it appears in the editor. Incorrect casing silently produces no effect — the parameter is ignored rather than raising an error.
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:
Field IDs in scripts must match the IDs configured in your Polarion project — for example, priority, dueDate, plannedEnd. Wrong field IDs return undefined silently. Verify field IDs in Administration > Work Items > Custom Fields or in the work item form layout.
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:
If your script throws an error or returns undefined, the card may render without the expected modification — or may not render at all, depending on how the parameter is used. Always return a default value (such as '') from all code paths.
5

Save and Verify

  1. Save the widget parameter editor.
  2. Save the page.
  3. Reload the board.
You should now see cards that match your script condition rendered differently from the rest — for example, highlighted with the CSS class you returned, or filtered from the board.
When writing a new item script, start with a condition that matches exactly one card you can visually identify. Confirm the expected card is affected before adding more complex logic.

Common Pitfalls

Configuration parameters in Planningboard are whitespace-sensitive. If you paste a script with leading or trailing whitespace into a parameter field, the parameter may not parse correctly. Trim the script content before saving.
If an item script throws a JavaScript runtime error, the board may silently fall back to the default card appearance without surfacing the error in the UI. Check your browser’s developer console for JavaScript errors if a script produces no visible effect.
Item scripts that modify card appearance do not affect swimlane sort order. Swimlane ordering is governed by the board’s sort configuration, not by per-card script results. If you need to reorder swimlanes, adjust the sort parameters in the widget configuration instead. See Sort Swimlanes.

Configuration Example

The following shows a complete item script parameter scenario: a board scoped to a project’s stories, where cards in Open status that have no assignee should be visually flagged.
Pair this with a custom CSS rule in your Polarion page or skin to apply a visible border or background tint to cards that receive the 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.
If the script has no visible effect and there are no console errors, double-check the exact parameter name in the widget editor and confirm the field IDs used in the script match those in your Polarion project.

See Also

KB Articles
  • Planningboard: Customizable Statistics and Capacity Indicators
  • Planningboard Widget Parameters
Support TicketsSource Code
  • Config.java
  • viewSetup.vm
  • PlanningBoardWidgetRenderer.java
  • PlanningBoardDataService.java
  • PlanningBoardWidget.java
Last modified on June 26, 2026