Default Context Menu Actions
When you right-click a cell in the Risksheet grid, the context menu displays built-in actions depending on the cell context and grid state:| Action | When Available | Description |
|---|---|---|
| Open Row Item | Always | Opens the current row’s work item in Polarion’s item editor |
| Open Linked Item | Cell contains a valid item link | Navigates to a linked work item from an itemLink column |
| Open Task Item | Cell contains a task link | Opens the task work item; label uses dataTypes.task.name if configured |
| New [Level] Item | Editable grid, showInMenu: true | Creates a new work item at the selected hierarchy level |
| Overwrite Row Item | Item has systemReferenceType: "reference" | Converts a referenced item to overwrite mode for local editing |
| Remove Row Item | Non-read-only grid | Removes the selected row from the grid |
| Freeze Pane | Always | Freezes columns to the left of the current column |
| Unfreeze Pane | Columns are frozen (frozenColumns > 0) | Removes column freezing |
| Debug | appConfig.debug: true | Outputs cell diagnostic info to the browser console |
Register Custom Context Menu Actions
Risksheet exposes an extensibility point throughwindow.risksheet.customContextMenuActions that allows external scripts to register additional menu items.
Step 1 — Define Action Functions
Create JavaScript functions on the globalwindow object. Each custom action needs an enable function (controls when the item is active) and an execute function (runs when clicked):
Step 2 — Register the Actions
Add your custom actions to thecustomContextMenuActions array:
| Property | Type | Description |
|---|---|---|
label | string | Text displayed in the context menu |
enableFn | string | Name of a window function that returns true to enable the action |
executeFn | string | Name of a window function that runs when the action is clicked |
Step 3 — Load the Script
Place the script in yourrisksheetTopPanel.vm Velocity template so it loads when Risksheet initializes:
Control New Item Menu Options
The “New [Level] Item” menu options are generated dynamically from thelevels configuration in risksheet.json. Use showInMenu to control which levels appear:
showInMenu to false hides that level from the context menu while keeping it functional in the grid hierarchy. This is useful for levels populated automatically or through imports.
Customize Task Menu Labels
The “Open Task Item” menu label dynamically reflects the configured task type name. SetdataTypes.task.name in your risksheet.json:
Overwrite Row Item
The “Overwrite Row Item” action converts a referenced item to overwrite mode, enabling local modifications to be saved back to the source. This action appears only when the selected item hassystemReferenceType set to reference.
Custom context menu actions for triggering document workflow transitions (e.g., changing document status from within Risksheet) are not natively supported as built-in menu items. Use the
customContextMenuActions extensibility point to call the workflow action servlet endpoint from your custom function.Verify Your Changes
After configuring custom context menu actions:- Reload the Risksheet page to load your script changes
- Right-click on a grid cell — you should now see your custom menu items alongside the built-in actions
- Verify that the
enableFncondition correctly enables/disables the action based on the selected item - Check the browser console for errors if a custom action does not appear
See Also
- Customize the Top Panel — add scripts and custom fields to the top panel area
- Configure Remove/Delete Actions — control how items are removed from the grid
- Understanding the Interface — overview of Risksheet UI components
- Create Custom Renderers — extend cell rendering with custom display logic
Sources
Sources
Support TicketsSource Code
RiskSheetContextMenu.tsRisksheetProjectProperties.javaShowConfigurationCommand.tsPolarionAppConfigManager.javaWorkflowActionServlet.java