Prerequisites
- A domain model with entity types defined
- Knowledge of the Polarion project IDs you want to filter by
- A sheet configuration with at least one data source
Step 1: Add Project Constraints to Entity Types
In your domain model YAML, add aconstraints section with project filtering to your entity type. The query engine uses the project.id field to scope queries:
SystemRequirement items from the project myProjectId are loaded into the sheet.
Step 2: Filter Across Multiple Projects
To load entities from multiple projects, provide a list of project IDs:| Constraint Syntax | Behavior |
|---|---|
id: singleProject | Filters to one project |
id: [projA, projB] | Filters to multiple projects (OR) |
| No project constraint | Uses current project context |
Step 3: Combine Project and Document Constraints
You can apply both project and document constraints for maximum precision:Step 4: Apply Project Constraints to Relationships
Project constraints can also be applied at the relationship level to control cross-project linking. Add constraints to the relationship’s navigation property:Step 5: Use Dynamic Project Context
For picker constraints that should adapt to the current project, use$context expressions:
Dynamic
$context expressions for project constraints are resolved at runtime. Verify the exact resolution behavior with your specific domain model configuration.Step 6: Debug Project Filtering
If your sheet shows unexpected results, the query engine provides debug logging that shows the exact Lucene queries being executed, including theproject.id filter fragments. Check the Polarion server logs for query output that includes the project scoping clause.
The project filter is applied as a Lucene query fragment in the format:
Verify
After configuring project constraints:- Open the powersheet document in Polarion
- You should now see only work items from the specified project(s)
- Expand related entities to confirm they also respect project boundaries
- If using picker constraints, open a relationship dropdown and verify it only shows items from the constrained projects
See Also
- Filter by Document — scope queries to specific documents
- Configure Constraints — full constraint configuration
- Write an Entity Query — entity query fundamentals
- Expand Navigation Properties — loading related entities
Sources
Sources
Source Code
QueryFactory.javaGenericQueryResolver.javaPolarionQueryProcessor.javaDatabridgeConstants.javaprod-powersheet-src/com.nextedy.powersheet.client/src/modules/DocumentProvider/DocumentProvider.tsx