Mapping Architecture
Core Mapping Properties
polarionType Property
Single Type Mapping (Scalar)
The most common pattern maps one entity type to one Polarion work item type using a scalar string value:UserNeed entity type maps to the Polarion work item type ID user_need. All queries for UserNeed entities resolve to work items of type user_need.
Multi-Type Mapping (Array)
A single entity type can map to multiple Polarion work item types by providing an array. This enables a unified view over work items of different types:polarionType is an array:
- Queries for the
Requiremententity type return work items matching any of the listed types - The first type in the array is used as the default when creating new work items
- All listed type IDs must exist in the Polarion project configuration
Omitted polarionType (Default Mapping)
When polarionType is not specified, the entity type name becomes the Polarion type ID:
Hazard entity maps to Polarion work item type Hazard. This convention works when the entity type name exactly matches the Polarion work item type ID defined in the project.
polarionProto Property
The polarionProto property specifies which Polarion prototype (object class) the entity represents. Most entity types use the default IWorkItem.PROTO, but special object types require an explicit prototype.
Available prototype values are enumerated from the Polarion platform at runtime. The JSON schema generator reads all valid prototype names to populate the
polarionProto enum constraint for IDE validation.Schema Validation
The JSON schema generated by Powersheet validatespolarionProto values against the set of prototypes available on the Polarion server. When editing data model YAML files with schema support enabled, the IDE provides:
- Autocomplete for valid
polarionProtovalues - Validation errors for unrecognized prototypes
- Type checking for
polarionType(accepts both string and array)
Built-in Entity Types
Powersheet recognizes several built-in entity types that map to Polarion objects. These types have specialized handling in the query processor and metadata system.The
Document entity type supports polarionType. When set, it filters documents to those matching a specific document type ID. This is useful for constraining picker dialogs and queries to a particular class of documents.Reserved Properties
Built-in entity types have reserved properties that are always set tofalse in the data model schema:
Type Mapping in Relationships
Relationship definitions reference entity types by their data model name (the YAML map key), not by their Polarion work item type ID:Relationship Navigation and Type Resolution
When a relationship links two entity types, Powersheet resolves thepolarionType of each entity to construct the appropriate Polarion query:
- The
fromentity type’spolarionTypeidentifies the source work item type - The
toentity type’spolarionTypeidentifies the target work item type - The
linkRolemaps to the Polarion link role connecting them directandbackproperties create navigation properties for traversal in each direction
- Navigating
direct(systemRequirements) from aUserNeedqueries Polarion forsys_reqwork items linked via thedecomposeslink role - Navigating
back(userNeeds) from aSystemRequirementqueries Polarion foruser_needwork items linked via the reverse ofdecomposes
Query Behavior with Type Mappings
The query processor usespolarionType mappings when translating data model queries to Polarion Lucene queries:
Security and Permissions
Before any query executes, Powersheet checks that the current user has read permission for the entity type being queried. Entity types can have permission annotations that restrict access. See Permissions for details.Document-Scoped Queries
When acurrentDocConstraint parameter is provided, the query processor restricts results to work items within a specific document. The constraint can reference either an entity type name or a navigation property path. Combined with polarionType, this enables document-scoped views over specific work item types.
Mapping Validation Rules
RTM Mapping Example
Standard RTM entity types with their Polarion type mappings:Cardinality Impact on Column Binding
ThepolarionType mapping interacts with relationship cardinality to determine how columns display data. The cardinality of the relationship between entity types determines the expand pattern and column binding syntax used in sheet configurations.
Many-to-One Example
EachUserNeed belongs to one Chapter. The direct navigation property chapter is scalar:
chapterrenders as a single-value reference pickerchapter.titledisplays the referenced entity’s title as read-only
Many-to-Many Example
UserNeed links to multiple SystemRequirement entities. The back navigation property uses a two-level expand:
- Many-to-many relationships use an association entity between the two types
- Source expand is two levels:
systemRequirements(association) thensystemRequirement(target) - Column binding uses dot notation:
systemRequirements.systemRequirement - The
createNew: trueoption enables inline creation of new linked work items
Complete YAML Example
Related pages: Data Model Types | Properties | Relationships | Cardinality | Link Roles | Constraints