Skip to main content

Query Types

Risksheet supports two query syntaxes:

Lucene Query Basics

Lucene queries filter work items based on field values using standard Polarion query syntax.

Operators

Common Fields

Query Assembly

diagram
The final query is assembled by combining four components with AND logic:
  1. Type filter — Work item type from dataTypes.<name>.type (additional types on a link column come from typeProperties.linkTypes), combined with OR if multiple
  2. Project scope — Current project identifier
  3. Document scope — Current document/module path (quoted to handle spaces)
  4. Custom query — Additional user-defined conditions from the query property
Empty conditions are automatically skipped. At least one work item type must be specified or the system returns an error.

Query in Configuration

Data Type Query

The dataTypes configuration uses the query property to add custom filtering to the generated query:

Escaped Quotation Marks in JSON

When embedding queries that contain quotation marks inside sheet configuration, escape the inner quotes with a backslash (\"):
Use \" to include quotation marks within JSON string values. This is standard JSON escaping and applies to all query strings in sheet configuration.

SQL Query Support

Risksheet supports SQL queries for complex filtering scenarios using the SQL:(...) prefix:
SQL query syntax and available tables/fields depend on your Polarion server version. Verify supported SQL constructs in your environment before deploying.

Query Factory

Query factories provide dynamic query filtering through custom JavaScript functions registered on the window.risksheet.queryFactories object. They enable context-aware filtering of linked items in autocomplete dropdowns.
Register the factory in a top panel script or external JavaScript:
See JavaScript API for the full query factory API.

Document Path Handling

Document IDs with _default/ prefix (default modules) have the prefix automatically stripped before query construction. Document paths containing spaces or special characters are automatically quoted in the generated query.

Autocomplete Search Behavior

The autocomplete suggestion system uses queries to search for matching work items:
Suggestions are automatically scoped to the current project. Cross-project suggestions are not available in the default autocomplete. Newly created items that have not been saved appear in suggestions for the current session.
See Suggestion and Autocomplete API for the full API reference.

Complete Example

A full configuration demonstrating query usage across data types and columns:
This configuration:
  • Loads FMEA risk items for productFamily_A, excluding those with rejected status
  • Loads mitigation task items, excluding closed items
  • Provides item link columns for requirements (with creation) and hazards, each with custom query factory filtering
Last modified on July 10, 2026