Skip to main content

API Endpoint

The suggestion API is accessed through the following endpoint:
GET /risksheet/suggestion/
POST /risksheet/suggestion/
Both GET and POST requests are supported for flexibility in different scenarios.

Request Parameters

ParameterTypeRequiredDescription
fieldstringYesThe field or column identifier to get suggestions for
projectstringYesThe Polarion project key to scope suggestions
querystringNoThe partial text the user typed to filter suggestions
limitintegerNoMaximum number of suggestions to return (default: 50)
fuzzybooleanNoEnable fuzzy matching for typo tolerance (default: true)
starbooleanNoEnable wildcard search with asterisk (*) character (default: true)
allbooleanNoRequire all keywords to match (AND logic) vs any keyword (OR logic) (default: false)
typestringNoWork item type filter for link suggestions
changesobjectNoLocal pending changes to include in suggestions

Response Format

The API returns an array of suggestion objects:
[
  {
    "id": "REQ-1234",
    "label": "User Authentication System",
    "type": "Requirement",
    "project": "PROJ",
    "description": "Handles user login and session management"
  },
  {
    "id": "*temp-1",
    "label": "New Risk Item",
    "type": "Risk",
    "isNew": true
  }
]

Suggestion Types

Text Field Suggestions

For regular text columns, the API returns previously entered values in that column across all work items.
PropertyTypeDescription
labelstringThe previously entered text value
frequencyintegerNumber of times this value appears in the column
typestringAlways “text” for text field suggestions
For item link columns, the API queries work items by ID and title using OData endpoints.
PropertyTypeDescription
idstringThe Polarion work item ID (e.g., “REQ-1234”)
labelstringThe work item title or display name
typestringThe work item type (Requirement, Task, etc.)
projectstringThe Polarion project key
descriptionstringAdditional work item metadata
isNewbooleanTrue if this is a locally created item (ID starts with *)
canCreatebooleanTrue if the user can create new items of this type
Task link columns provide filtered suggestions excluding tasks already in the current table.
PropertyTypeDescription
idstringThe task work item ID
labelstringTask title
typestringAlways the configured task type
isSelectedbooleanTrue if this task is already linked in this table
disabledbooleanTrue if the task cannot be selected (already in table)

Enum Suggestions

For enumeration columns, the API returns available enum values from configuration.
PropertyTypeDescription
idstringThe enumeration ID/value
labelstringThe display label for this enum value
descriptionstringAdditional enum description
ratingstringAssociated rating for severity/occurrence enums

Search Features

When enabled (default), fuzzy matching allows suggestions even with minor spelling variations:
User types: "authentiction"
Returns: "Authentication System" (fuzzy match, 1 character difference)
Users can search with asterisk (*) wildcards to find partial matches:
Query: *api*
Returns: "REST API", "GraphQL API", "Payment API" (all containing 'api')

Query: user*
Returns: "User Authentication", "User Preferences", "User Groups"

Keyword Matching Modes

The all parameter controls how multiple keywords combine: AND Mode (all=true):
Query: "user authentication"
Returns: Only items containing BOTH "user" AND "authentication"
OR Mode (all=false, default):
Query: "user authentication"
Returns: Items containing "user" OR "authentication" OR both

Project-Scoped Filtering

All suggestions are automatically scoped to the specified Polarion project. Cross-project suggestions are not returned by default, though configuration may support cross-project linking scenarios.

Local Changes Integration

The changes parameter allows newly created items to appear in suggestions before they’re saved to the server:
// Newly created risk item (not yet saved)
const changes = {
  "*new-risk-1": {
    "id": "*new-risk-1",
    "title": "New Safety Risk",
    "type": "Risk"
  }
};

// This item now appears in link suggestions
New items are identified by IDs starting with * and typically appear at the top of suggestion lists.

Result Limiting

The limit parameter prevents overwhelming UI with too many suggestions:
Limit ValueUse CasePerformance
10-20Constrained UI (dropdown height)Very fast
50Default balanced settingFast
100+Comprehensive searchMay require refined query

Column-Type Specific Configuration

Suggestion behavior varies by column type:
Text Field:
  - Suggests previously entered values
  - Configurable via suggestTextFields property
  - Includes local unsaved entries

Item Link:
  - Queries Polarion work items by ID/title
  - Supports custom query filters
  - Can enable creation of new items (canCreate=true)

Task Link:
  - Filters out already-selected tasks
  - Supports dependency-based filtering
  - Validates uniqueness

Enum Dropdown:
  - Returns configured enumeration values
  - Supports dependent enum relationships
  - Shows rating associations

Validation and Error Handling

Invalid Selections

When a user selects or enters an invalid value, the cell receives the cell-invalid CSS class:
<div class="wj-cell cell-invalid">Invalid Entry</div>
This typically renders with a red border or highlight to indicate validation failure.

Duplicate Prevention

For multi-item link columns, the system prevents selecting the same item twice:
User selects: REQ-1234
User tries to select: REQ-1234 again
Result: Toast message "Item is already selected"
Action: Selection is ignored

API Flow Diagram

diagram

Configuration Properties

Global Settings

PropertyTypeDefaultDescription
global.suggestTextFieldsbooleantrueEnable text field autocomplete suggestions
suggestionLimitinteger50Maximum suggestions to return
fuzzySearchEnabledbooleantrueEnable fuzzy matching by default
wildcardSearchEnabledbooleantrueEnable wildcard (*) searching

Project-Level Settings

PropertyTypeDefaultDescription
suggester.keywordMandatorybooleanfalseRequire all keywords to match
suggester.fuzzyMatchbooleantrueEnable fuzzy search for this project
suggester.wildcardSearchbooleantrueEnable wildcard search for this project
suggester.resultLimitinteger20Maximum suggestions for this project
suggester.allFieldSearchbooleanfalseSearch all fields vs primary fields only

Column-Specific Settings

PropertyTypeDefaultDescription
column.canCreatebooleanfalseAllow creation of new linked items from suggester
column.queryFactorystringnullCustom OData filter function for suggestions
column.validatorstringnullCustom validation function for suggested values
Reduce the limit parameter for constrained UIs or set fuzzySearchEnabled=false for faster exact matching when your data is clean and complete.
Local changes (unsaved items) are only visible to the current user session. They are not persisted until the document is saved to the server.
For advanced scenarios, use queryFactory to inject OData filter expressions. This enables context-aware suggestions based on other column values or business logic.
Source Code
  • CellEditorFormatter.ts
  • TextEditor.ts
  • SuggestionServlet.java
  • AppConfig.ts
  • RisksheetProjectProperties.java