Skip to main content

Prerequisites

Before configuring dropdown categories, ensure you have:
  • Administrative access to edit RISKSHEET configuration
  • A custom enumeration created in Polarion Administration
  • Familiarity with the top panel template

Step 1: Create the Enumeration in Polarion

Navigate to Administration > Work Items > Enumerations and create a new enumeration with your category values:
Enum ID: vehicleCategories
Values:
  - sedan
  - suv
  - truck
  - compact

Step 2: Add Dropdown to Top Panel

Edit the risksheetTopPanel.vm Velocity template to add the dropdown menu. Access this through Menu > Configuration > Edit Risksheet Configuration > Templates tab. Add the following HTML to your template:
Vehicle Category:
<select name="categoryFilter" id="categoryFilter">
  <option value="">-- All Categories --</option>
  <option value="sedan">Sedan</option>
  <option value="suv">SUV</option>
  <option value="truck">Truck</option>
  <option value="compact">Compact</option>
</select>
For dynamic dropdown population from Polarion enumerations, reference the enum values using Velocity syntax: #foreach($value in $enums.vehicleCategories) to avoid hardcoding options.

Step 3: Create Query Factory Function

In the risksheet.json configuration, add a query factory function that reads the dropdown value and builds a query filter:
"queryFactories": {
  "categoryQuery": "function(info){ var category = $('#categoryFilter').val(); if(category) { return 'category:' + category; } return ''; }"
}
The query factory returns a Polarion query string fragment that filters items by the selected category field. Modify the item link column configuration to use the query factory:
{
  "id": "relatedVehicle",
  "header": "Related Vehicle",
  "type": "itemLink",
  "typeProperties": {
    "linkRole": "relatedVehicle",
    "linkTypes": "vehicle",
    "queryFactory": "categoryQuery"
  }
}
The queryFactory property references the function name defined in step 3.

Configuration Flow

diagram

Common Patterns

Multiple Dependent Dropdowns

Combine multiple dropdown selections in a single query factory:
"queryFactory": "function(info){ 
  var cat = $('#categoryFilter').val(); 
  var status = $('#statusFilter').val(); 
  var query = ''; 
  if(cat) query += 'category:' + cat; 
  if(status) query += (query ? ' AND ' : '') + 'status:' + status; 
  return query; 
}"

Required Category Selection

Show no results until a category is selected:
"queryFactory": "function(info){ 
  var cat = $('#categoryFilter').val(); 
  if(!cat) return 'id:NONEXISTENT'; 
  return 'category:' + cat; 
}"
Query factories execute when the autocomplete dropdown opens. If users change the top panel filter after selecting an item, previously selected items remain linked. Users must manually remove and re-add items if category filters change.

Verification

  1. Save your configuration changes
  2. Reload the RISKSHEET page
  3. You should now see your custom dropdown in the top panel
  4. Select a category value
  5. Click into an item link column cell
  6. The autocomplete suggestions should display only items matching the selected category
  7. Change the dropdown selection and verify the autocomplete results update accordingly
Include an empty option (value="") in your dropdown to allow users to clear the filter and see all available items.

Troubleshooting

Dropdown appears but filtering doesn’t work: Verify the queryFactory function name in the column configuration exactly matches the key in queryFactories. JavaScript is case-sensitive. JavaScript errors in browser console: Check that your jQuery selector matches the dropdown’s id attribute. Verify the query syntax returns valid Polarion query strings. Filter works once then stops: Query factories cache results. If the filter should update dynamically, users need to close and reopen the autocomplete dropdown after changing selections.

See Also

KB ArticlesSupport TicketsSource Code
  • EnumComboBox.ts
  • MultiEnumEditor.ts
  • RiskSheetContextMenu.ts
  • AppConfigParser.ts