Query Parameters
Parameters are passed to the query engine through the EntityQuery parameters property and control runtime behavior:
Parameter Type Default Description revisionstringNone Project baseline or revision identifier. Executes query against historical data snapshot. See Baseline and Revision Queries currentDocstringNone Document ID in folder/name format. Filters results to the specified document. See Document Filtering currentDocConstraintstringNone Entity type name or navigation property path for document scoping. Only applies document filter when this matches the query’s from entity explainbooleanfalseEnables debug output showing query translation details
Document Context
Powersheet automatically applies document context to all queries to ensure data is scoped to the current Polarion document:
Document ID Parameter
The document.id parameter is automatically set to the full document path (folder/name) of the current Polarion LiveDoc:
sources :
- id : requirements
model : rtm
query :
from : UserNeed
where : <WHERE>
constraints :
applyCurrentDocumentTo : UserNeed
When applyCurrentDocumentTo matches the query’s from entity type, the query framework injects a document-scoping filter that restricts results to items within the current document.
Document Filtering Mechanism
The document filter works by adding predicates for document.moduleFolder and document.moduleName to the where clause. This is applied automatically — no manual filter configuration is needed.
For details on document constraint variants (root vs. downstream), see Document Filtering .
Project Context
Queries are automatically scoped to the current Polarion project. The query resolver applies a project.id filter to all executed Lucene queries:
Context Behavior Single project Adds project.id:"projectId" to Lucene query Multi-project Adds project.id:"proj1" OR project.id:"proj2"
For project scoping details, see Project Scoping .
Security Context
Before any query executes, the security context is checked:
Check Behavior Entity type read permission Query fails fast if the current user lacks read permission for the target entity type Property-level permissions Individual properties may be restricted (columns show “denied” indicator)
See Permissions for entity-level access control configuration.
Baseline and Revision Context
Queries can target historical data by specifying a baseline or revision:
# Revision comes from query parameters or context baseline
When a revision is set:
Data is fetched from the specified point in time
Work items reflect their state at that baseline
Changes made after the baseline are not visible
See Baseline and Revision Queries for configuration details.
Constraint Context
Constraints from the domain model and sheet configuration are applied as query context annotations:
Constraint Type Purpose Configuration Load constraints (load) Filter which entities can be loaded and displayed Domain model constraints Save constraints (create/save) Validate which entities can be created or modified Domain model constraints Pick constraints (pick) Filter options in picker/dropdown fields Domain model constraints Document constraint (applyCurrentDocumentTo) Scope to current document Sheet configuration sources[].constraints
Constraints support dynamic value resolution using $context expressions:
constraints :
load :
project :
id : $context.source.project.id
Dynamic Context Values
Runtime context values are accessible through $context dot-notation expressions:
Expression Description $context.source.project.idCurrent Polarion project ID $context.document.idCurrent document path (folder/name)
Additional context variables may be available depending on the Powersheet version and deployment configuration. Contact your administrator for the complete list of available context paths.
Server-Side Rendering Context
For server-rendered properties (Velocity templates), the rendering context includes:
Variable Description itemCurrent Polarion work item object txCurrent transaction context contextRendering context object pObjectPolarion persistent object reference
See Context Variables for the complete server rendering context.
Enum Resolution Context
When picker fields need to load available enum options, the query framework creates specialized enum queries using context information:
polarionProto — Polarion prototype identifier
polarionType — Work item type for the enum field
projectId — Current project scope
enumId — Enum option type identifier
Enum sources are auto-discovered from entity metadata — no manual configuration is required.
Complete YAML Example
sources :
- id : rtm-requirements
title : Requirements
model : rtm
query :
from : UserNeed
where : <WHERE>
constraints :
applyCurrentDocumentTo : UserNeed
expand :
- name : systemRequirements
expand :
- name : designRequirements
expand :
- name : verificationTestCases
In this configuration:
Document context is applied via applyCurrentDocumentTo: UserNeed, scoping results to the current document
Project context is automatically applied by the query resolver
Security context is enforced before query execution
Expansion paths define the hierarchy of related entities to load
Related Pages
Sources: Code: PolarionQueryProcessor.java, QueryFactory.java, QueryManager.tsx, ModelProvider.tsx, GenericQueryResolver.java, SaveTest.java
Source Code
SaveTest.java
PolarionQueryProcessor.java
QueryFactory.java
prod-powersheet-src/com.nextedy.powersheet.client/src/modules/ModelProvider/ModelProvider.tsx
GenericQueryResolver.java