Home Analyst Portal

Extending the default CR form type projection does not seem to work for a specific relation

Mark_BlokMark_Blok Partner IT Monkey ✭
I want my users to be able to add and remove workitems in the portal for relationship: "System.WorkItemResolvesWorkItem".

Because this relationship is not part of the default Cireson.ChangeRequest.ViewModel type projection, I extended this with some extra components. Because I need both the "Source" and "Target" relationship I added two components to the type projection:

<Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemResolvesWorkItem']$" Alias="ResolvesWorkItemSource" />

 <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemResolvesWorkItem']$ SeedRole='Target'" Alias="ResolvesWorkItemTarget" />

After importing the typeprojection in SCSM and run the following command :

"Get-SCSMTypeProjection -Name SK.Cireson.ChangeRequest.ViewModel"

The output is as follows:

ProjectionType: SK.Cireson.ChangeRequest.ViewModel
ProjectionSeed: System.WorkItem.ChangeRequest
Components:
   Alias                                    TargetType                                                                               TargetEndPoint
   -----                                      ----------                                                                                      ---------------
   AssignedTo                         System.User                                                                             AssignedWorkItem
   AffectedUser                       System.User                                                                             RequestedWorkItem
   CreatedByUser                    System.User                                                                            CreatedWorkItem
   AffectedConfigItems            System.ConfigItem                                                                   HasRelatedWorkItems
   RelatedConfigItems             System.ConfigItem                                                                   RelatesToConfigItem
   ActionLogs                           System.WorkItem.TroubleTicket.ActionLog                              AppliesToWorkItem
   AnalystComments                System.WorkItem.TroubleTicket.AnalystCommentLog            AppliesToWorkItem
   UserComments                    System.WorkItem.TroubleTicket.UserCommentLog                 AppliesToWorkItem
   Activities                               System.WorkItem.Activity                                                         Activity
   FileAttachments                    System.FileAttachment                                                            FileAttachment
   RelatedWorkItem                  System.WorkItem                                                                     RelatesToWorkItem_
   RelatedWorkItemsSource     System.WorkItem                                                                     RelatesToWorkItem
   BillableLogs                           System.WorkItem.BillableTime                                                AppliesToWorkItem
   ResolvesWorkItemSource     System.WorkItem                                                                    ResolvedByWorkItem
   ResolvesWorkItemTarget      System.WorkItem                                                                    ResolvedByWorkItem

My problem with this output is that the target Enpoint for both source and target show "ResolvedByWorkItem". This is not what I expected because the xml of the relationship looks like this:

<?xml version="1.0" encoding="utf-8"?><RelationshipType ID="System.WorkItemResolvesWorkItem" Accessibility="Public" Abstract="false" Base="System!System.Reference"><Source ID="ResolvesWorkItem" MinCardinality="0" MaxCardinality="2147483647" Type="System.WorkItem" /><Target ID="ResolvedByWorkItem" MinCardinality="0" MaxCardinality="2147483647" Type="System.WorkItem" /></RelationshipType>

So I expected to see both the "ResolvesWorkItem" and "ResolvedByWorkItem" EndPoints. But I get two times the same.

The default projection type uses similar code for the System.WorkItemRelatesToWorkItem relation. The XML of that relation looks like this:

<?xml version="1.0" encoding="utf-8"?><RelationshipType ID="System.WorkItemRelatesToWorkItem" Accessibility="Public" Abstract="false" Base="System!System.Reference"><Source ID="RelatesToWorkItem" MinCardinality="0" MaxCardinality="2147483647" Type="System.WorkItem" /><Target ID="RelatesToWorkItem_" MinCardinality="0" MaxCardinality="2147483647" Type="System.WorkItem" /></RelationshipType>

For this relation the output does show both the "RelatesToWorkItem" and "RelatesToWorkItem_" endpoints.

Does anybody have a clue what I am missing here.. how can I get to the Resolvesworkitem so I can use and set this relation in a custom form in the portal?

Sign In or Register to comment.