Change Request Primary Owner
I've followed a similar path to this: https://community.cireson.com/discussion/169/add-support-group-field-to-portal-ma-activity-form
I've added the class using the authoring tool, created it in the same way as the Incident Primary owner, edited the CR form.js
I can now see the primary owner field and I can select an analyst. However when I hit apply the field is cleared. I'm guessing I'm missing something to do with relating the field to the ticket?
Best Answer
-
Conner_Wood Customer Ninja IT Monkey ✭✭✭✭Ah, I had assumed you already had your type projection created and configured for the form by following the guide Brett mentioned above. I didn't think that because your ChangeRequest.js file didn't contain a custom Form Definition, you probably didn't have "Assign Forms to Active Directory Groups" filled out with a custom Type Projection. Ok, so maybe I actually forgot about this part but whatever, take your pick already
Also there is no RelationshipClassID property atm, it'd be up to Cireson to make it happen.
.......
Now then, the reason your web form is now freezing is because you have specified the "PropertyName" correctly as it does find the matching endpoint of a relationship, but it cannot find said relationship in the default class projection in the Cireson Portal MP ( if you export it from the console and select no to get raw xml, you will get an xml file called "Cireson.Analyst.Web.Console" which contains all the default class projections the web portal uses).
It's a good idea to copy their default Projection and add your other relationship(s) to it as you still need what they've defined. In this case you'd be looking for TypeProjection "Cireson.ChangeRequest.ViewModel"
So yes, I did not cover that you also must create yet another sealed MP . Following my earlier structure for the "Authorizing Manager" relationship, this is what the TypeProjection part would look like:<TypeDefinitions> <EntityTypes> <TypeProjections> <TypeProjection ID="<b><i>My.WebPortalChangeRequestProjection</i></b>" Accessibility="Public" Type="CoreChange!System.WorkItem.ChangeRequest"> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="AffectedUser" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedByUser" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AffectedConfigItems" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToConfigItem']$" Alias="RelatedConfigItems" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasActionLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.ActionLog']$" Alias="ActionLogs" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.AnalystCommentLog']$" Alias="AnalystComments" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasCommentLog' TypeConstraint='WorkItem!System.WorkItem.TroubleTicket.UserCommentLog']$" Alias="UserComments" /> <Component Path="$Target/Path[Relationship='CoreActivity!System.WorkItemContainsActivity']$" Alias="Activities"> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemCreatedByUser']$" Alias="CreatedBy" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="AssignedTo" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAboutConfigItem']$" Alias="AffectedConfigItems" /> <Component Path="$Target/Path[Relationship='CoreActivity!System.ReviewActivityHasReviewer']$" Alias="Reviewer"> <Component Path="$Target/Path[Relationship='CoreActivity!System.ReviewerIsUser']$" Alias="User" /> <Component Path="$Target/Path[Relationship='CoreActivity!System.ReviewerVotedByUser']$" Alias="VotedBy" /> </Component> </Component> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasFileAttachment']$" Alias="FileAttachments"> <Component Path="$Target/Path[Relationship='SupportingItem!System.FileAttachmentAddedByUser']$" Alias="FileAttachmentAddedBy" /> </Component> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem']$" Alias="RelatedWorkItem"> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="RelatedWorkItemAssignedTo" /> </Component> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemRelatesToWorkItem' SeedRole='Target']$" Alias="RelatedWorkItemsSource"> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAffectedUser']$" Alias="SourceAffectedUser" /> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$" Alias="SourceAssignedToUser" /> </Component> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItemHasBillableTime']$" Alias="BillableLogs"> <Component Path="$Target/Path[Relationship='WorkItem!System.WorkItem.BillableTimeHasWorkingUser']$" Alias="WorkedUponByUser" /> </Component> <b><i> <Component Path="$Target/Path[Relationship='MyChangeExtension!ChangeRequest.AuthorizedBy']$" Alias="ChangeAuthorizedByUser" /></i></b> </TypeProjection> </TypeProjections> </EntityTypes> </TypeDefinitions><br>
Once you do that, seal the MP and import through the SCSM Console.... while the Cireson Cache Builder syncs the type projection, you will need to follow that guide as mentioned earlier to get the GUID the TypeProjection has been generated from import and assigned in SCSM.
To do that, use PowerShell with SMLets installed and run the command with the ID you gave your custom TypeProjection, following my structure it would be:(Get-SCSMTypeProjection -Name "<b><i>My.WebPortalChangeRequestProjection</i></b>").Id
Make note of the GUID which is the FORM PROJECTION ID because you'll need to enter it later. Next in your ChangeRequest.js you'd create a new form definition following the guide and make note of the FORM ID you give it.
Note: You should keep the "Default" and "DefaultEndUser" as original since they will freeze with custom relationships not mapped in the Cireson Defined TypeProjection as you've found out. Remember, you are now going forward with your custom forms with your custom type projections.
At this point, follow the remaining guide to enter the information into the "Assign Forms to Active Directory Groups".
Y'know, I think I know why I forgot about this part, it's pretty painful the first time through. Good Luck!
7
Answers
Not sure if I am missing something or not.....
The ChangeRequest.js looks fine to me.
Let me chase up some other pieces and I'll let you know.... Stay Tuned
I was unaware of the "FilterByAnalyst:TRUE" property you have included for this UserPicker, can you confirm if not having it specified will allow you to save it correctly.
I also had to have a custom relationship called "Authorizing Manager" for CR and SR tickets and this is how I would set up the structure knowing what I learned:
ChangeRequest.js
My.ChangeRequest.Extension
My.ChangeRequest.Extension.DataWarehouse
Note: Did you notice that for the ChangeRequest.js file I had to set the PropertyName to the Custom Relationship Target ID ( CRAuthorizer ) and it must be a unique name ID so the Cireson Portal can correctly query the custom relationship. In hindsight perhaps Cireson should consider functionality for specifying a full relationship endpoint path like so ( assuming '\' would be a valid separator character that the IDs could not have ):
Or Perhaps another js property to ensure the correct relationship is grabbed
If Cireson already has this functionality, why could I not find any documentation?
But it is a little buried.
If so, then the data being saved is with that relationship not with the property name.
This KB article walks you through how to do what you are after: https://support.cireson.com/KnowledgeBase/View/1174#/
Hopefully this makes more sense.
So here's my XML
I'm using the Cireson Change Request Support group extension and adding to it as it already extends the CR class
So following @Conner_Wood example, i have tried:
Still missing something though The CR just hangs on opening.
Filter by analyst makes no difference with or without, same result.
Thanks for all the help so far everyone! Really appreciate it.
Also there is no RelationshipClassID property atm, it'd be up to Cireson to make it happen.
.......
Now then, the reason your web form is now freezing is because you have specified the "PropertyName" correctly as it does find the matching endpoint of a relationship, but it cannot find said relationship in the default class projection in the Cireson Portal MP ( if you export it from the console and select no to get raw xml, you will get an xml file called "Cireson.Analyst.Web.Console" which contains all the default class projections the web portal uses).
It's a good idea to copy their default Projection and add your other relationship(s) to it as you still need what they've defined. In this case you'd be looking for TypeProjection "Cireson.ChangeRequest.ViewModel"
So yes, I did not cover that you also must create yet another sealed MP . Following my earlier structure for the "Authorizing Manager" relationship, this is what the TypeProjection part would look like:
Once you do that, seal the MP and import through the SCSM Console.... while the Cireson Cache Builder syncs the type projection, you will need to follow that guide as mentioned earlier to get the GUID the TypeProjection has been generated from import and assigned in SCSM.
To do that, use PowerShell with SMLets installed and run the command with the ID you gave your custom TypeProjection, following my structure it would be:
Make note of the GUID which is the FORM PROJECTION ID because you'll need to enter it later. Next in your ChangeRequest.js you'd create a new form definition following the guide and make note of the FORM ID you give it.
Note: You should keep the "Default" and "DefaultEndUser" as original since they will freeze with custom relationships not mapped in the Cireson Defined TypeProjection as you've found out. Remember, you are now going forward with your custom forms with your custom type projections.
At this point, follow the remaining guide to enter the information into the "Assign Forms to Active Directory Groups".
Y'know, I think I know why I forgot about this part, it's pretty painful the first time through. Good Luck!