Prerequisites
- A domain model with entity types and
constraintsconfigured - A sheet configuration with at least one data source
- A Polarion LiveDoc containing the work items you want to filter
Step 1: Understand Document Constraint Scoping
Powersheet can automatically scope queries to the current document. This happens through theconstraints section of your domain model, which defines how entity types relate to documents.
Step 2: Add Load Constraints to Your Entity Type
In your domain model YAML, add aconstraints block with a load section that defines document filtering criteria:
SystemRequirement entity to only load items from the document at Requirements/System-Requirements.
Step 3: Use Dynamic Document Constraints
For more flexible filtering, use$context.source.document to dynamically reference the current document:
Step 4: Filter by Document Type
You can also constrain entity loading by documenttype:
Hazard work items from documents whose Polarion type is riskAnalysis.
Step 5: Apply Document Constraints to Picker Filters
When creating links between entities, you may want the picker dropdown to show only items from specific documents. Usepick constraints:
Step 6: Combine Document and Type Constraints
For precise scoping, combine document constraints with theallowedWITypes property:
The
allowedWITypes property enables document-based routing of entities when multiple work item types map to a single entity type. Verify the exact behavior for your configuration.Verify
After applying document constraints:- Open the powersheet document in Polarion
- You should now see only work items that match the document filter criteria
- If using picker constraints, click a relationship cell and confirm the dropdown only shows items from the constrained documents
- Items from other documents should not appear in the sheet
See Also
- Filter by Project — scope queries to specific Polarion projects
- Configure Constraints — full constraint configuration guide
- Write an Entity Query — general query writing
- Use Predicates — query predicate syntax
Sources
Sources
KB ArticlesSource Code
PolarionQueryProcessor.javaQueryFactory.javaprod-powersheet-src/com.nextedy.powersheet.client/src/modules/ModelProvider/ModelProvider.tsxprod-powersheet-src/com.nextedy.powersheet.client/src/modules/QueryManager/QueryManager.tsxprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yaml