Skip to main content

Overview

Queries determine the scope of data loaded into a Risksheet:
  • Master query: Which risk items appear as main rows
  • Task query: Which mitigation/downstream items are available for linking
Queries use Lucene syntax combined with Polarion-specific field names and operators.

Basic Syntax

Field:Value Matching

Match items where a field equals a specific value:
type:requirement
status:open
project:MyProject

Multiple Conditions (AND)

All conditions must match (AND logic):
type:requirement AND status:open AND project:MyProject

Multiple Values (OR)

Any value can match (OR logic):
type:(requirement OR task)
status:(open OR in_progress)

Negation (NOT)

Exclude items matching a condition:
type:requirement NOT status:closed

Polarion-Specific Fields

Standard Work Item Fields

FieldTypeExampleNotes
typestringtype:requirementWork item type (requirement, task, defect, etc.)
statusstringstatus:openWorkflow status
projectstringproject:MyProjectProject ID
titlestringtitle:"System Safety"Item title (quote for exact match)
idstringid:REQ-001Work item ID
assigneestringassignee:john.doeAssigned user login
createddatecreated:[2025-01-01 TO 2025-12-31]Creation date range
modifieddatemodified:[2025-01-01 TO NOW]Last modified date range
authorstringauthor:jane.smithItem creator

Module/Document Fields

FieldTypeExampleNotes
modulestringmodule:"FMEA/System"Wiki document/module containing the item
spacestringspace:defaultDocument space
FieldTypeExampleNotes
linkedWorkItem.typestringlinkedWorkItem.type:taskType of linked item
linkedWorkItem.statusstringlinkedWorkItem.status:resolvedStatus of linked item
linkedRolestringlinkedRole:implementsLink role name

Date Range Queries

Inclusive Range

Match items created between two dates:
created:[2025-01-01 TO 2025-12-31]

Open-Ended Range

Items created after a specific date:
modified:[2025-01-01 TO NOW]
Items created before a specific date:
created:[* TO 2025-01-01]

Phrase Search (Exact Match)

Quote phrases to match exact text:
title:"System Design Review"

Substring/Contains

Match items containing text anywhere in a field:
title:safety
This matches “Safety Analysis”, “System Safety”, etc. Use * for any characters, ? for single character:
id:REQ-*
status:in_progre?

Configuration Examples

Example 1: FMEA Failure Modes

Load all requirement-type items in the current document:
{
  "master": {
    "types": "requirement",
    "query": "type:requirement"
  }
}
Expanded query automatically adds project and document scope:
type:requirement AND project:MyProject AND module:"FMEA/FailureModes"

Example 2: Open Tasks Only

Retrieve only non-closed mitigation tasks:
{
  "task": {
    "types": "task",
    "query": "type:task AND status:(open OR in_progress)"
  }
}

Example 3: Multiple Item Types

Include both requirements and defects as risks:
{
  "master": {
    "types": "requirement defect",
    "query": "type:(requirement OR defect)"
  }
}

Example 4: Exclude Draft Items

Show all items except those in draft status:
{
  "master": {
    "types": "requirement",
    "query": "type:requirement NOT status:draft"
  }
}

Example 5: Recently Modified

Show only items modified in the last 30 days:
{
  "master": {
    "types": "requirement",
    "query": "type:requirement AND modified:[2024-12-12 TO NOW]"
  }
}

Query Scope and Expansion

Automatic Scope Addition

The RISKSHEET system automatically adds scope to queries: Original query:
type:requirement status:open
Expanded query (sent to Polarion):
type:requirement AND status:open AND project:MyProject AND module:"FMEA/System"
Project and module (document) are always added automatically.

Document ID Handling

Document IDs with the _default/ prefix are automatically normalized: Input: module:"_default/MyFolder/MyDoc" Processed to: module:"MyFolder/MyDoc"

Query Processing Flowchart

diagram

Custom Field Queries

Simple Custom Fields

Query custom field values using the field key:
custom_risk_area:"electrical safety"
custom_priority:high

Custom Field Patterns

PatternExampleMatches
String matchcustom_phase:"Design"Exact value
Enum valuecustom_category:(A OR B OR C)Multiple options
Date rangecustom_deadline:[2025-01-01 TO 2025-12-31]Date bounds
Numericcustom_points:[10 TO 100]Numeric range

Document-Level Custom Fields

For queries that filter by document-level custom field values, use the .KEY syntax:
document.custom_phase:"Requirements"
This filters work items based on a custom field value on the document itself (not the item).

Linked Item Queries

Query Items Linked to Specific Type

Find items that are linked to tasks:
linkedWorkItem.type:task
Find items using a specific link relationship:
linkedRole:"implements"

Combined: Items Linked as “Implements”

linkedRole:"implements" AND linkedWorkItem.type:task

Special Query Values

Current User

Some Polarion implementations support dynamic values:
assignee:$currentUser
Check your Polarion version for support.

Empty/Null Fields

Match items with unset fields:
assignee:[* TO *]
Or exclude empty fields:
NOT assignee:[* TO *]

Query Validation

Invalid queries are caught during parsing:
  • Mismatched quotes: title:"System Safety (missing closing quote)
  • Invalid operators: AND OR without operands
  • Field typos: typ:requirement (should be type)
  • Unescaped special chars: title:System&Safety (& must be escaped or query split)
If a query is invalid, the RISKSHEET may:
  1. Log an error in the browser console
  2. Use a fallback query (usually all items)
  3. Display an error message in the UI

Performance Considerations

  • Use specific type filters to reduce search space
  • Add status filters to exclude closed/archived items
  • Avoid overly broad text searches (title:*)
  • Use date ranges to limit historical data

Multi-Project Queries

By default, queries are scoped to the current project. To query across projects:
RISKSHEET does not support built-in cross-project queries. To aggregate data from multiple projects, consider:
  • Creating separate Risksheets per project
  • Using linked work items to reference cross-project items
  • Configuring a multi-project Risksheet with cross-project links
Support TicketsSource Code
  • QueryBuilder.java
  • AppConfig.ts
  • MultiItemLinkEditor.ts
  • SuggestionServlet.java
  • OpenInTableCommand.ts