Home Analyst Portal

new custom relation on the change request form

Mark_BlokMark_Blok Partner IT Monkey ✭

I created a new reference relation between the Change request class and the Release request class. Goal is to log on which release a change request was submitted. So the relation can only be bound to 1 release record. This relationship work correctly. Now I want to edit this relation in the portal. I followed all the steps in https://support.cireson.com/KnowledgeBase/View/1174#/

The only part I cannot find is which DataType to us. I followed the following instructions: https://support.cireson.com/KnowledgeBase/View/51?selectedtab=enduser#/

I used an objectpicker to make the Release selectable in the change form. But it seems this DataType does not support workitems and only configitems. I use the following DataType def in my custom form definition:

DataType: "ObjectPicker", PropertyDisplayName: "Submitted On", PropertyName: "Target_61159058_73b9_44ce_8b43_d4fb3c43aa8a", ClassId: "d02dc3b6-d709-46f8-cb72-452fa5e082b8"

If I change the ClassID to a CI class, the correct CI's are shown, if I use any of the work item classes, it shows nothing.

Am I missing something, Which DataType should be used for this relation to be editable in the portal?

Best Answer

  • Mark_BlokMark_Blok Partner IT Monkey ✭
    Answer ✓
    Together with John Doyle we tried to troubleshoot the issue. It seems that the object picker is indeed scoped to config items and therefor cannot be used. The multiple object picker should work, only we found that when used with a custom relation with 0:1 functionality it breaks. It expects an array of objects but receives a single object instead. Other than these two their are currently no object pickers available so this config is currently not possible in the portal. John has forwarded this to the dev team and they will try to find the best solution. For now the workaround is to change my relationship to 0:many and handle situations where user relate more than one Release record differently, I suppose I will create a runbooks to send an email to the user when this happens.

Answers

  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    edited December 2016
    There is the undocumented multi-picker control Cireson mentioned to me,I think it could work even though your relationship is 1 to many (1 RR can hold multiple CRs), correct?

    I know for my custom user relationship that is 1:many (1 ticket to many users) with a Target Cardinality of 0:1, I made it work with:
    { DataType: "UserPicker", PropertyDisplayName: "Authorizing Manager", PropertyName: "SRAuthorizer" }

    <RelationshipType ID="ServiceRequest.AuthorizedBy" Accessibility="Public" Abstract="false" Base="System!System.Reference">
      <Source ID="ServiceRequestAuthorizedBy" MinCardinality="0" MaxCardinality="2147483647" Type="CoreServiceRequest!System.WorkItem.ServiceRequest" />
      <Target ID="SRAuthorizer" MinCardinality="0" MaxCardinality="1" Type="System!System.User" />
    </RelationshipType>

    PropertyName references the Target Endpoint ID of the relationship (be warned: it must be unique in SCSM).


    If the relationship not many:many, then I'd assume the "​ObjectPicker" is what appears to be needed, but if it doesn't work, perhaps Cireson needs to fix this functionality.


    Edit:  I suppose the other possibility is trying different GUIDs in ClassId.
    • Release Record: d02dc3b6-d709-46f8-cb72-452fa5e082b8
    • Change Request: e6c9cf6e-d7fe-1b5d-216c-c3f5d2c7670c
    • Potentially try Relationship Class GUID.....
    You'd think Cireson would have an example on their Knowledge Base of this, ah well.

  • Mark_BlokMark_Blok Partner IT Monkey ✭
    I will check the multi picker control and report back if that solved it.
  • Mark_BlokMark_Blok Partner IT Monkey ✭

    I added the following to my custom form def:

                                    {
                                        name: "Submitted On",
                                        type: "multipleObjectPicker",
                                        PropertyName: "Target_61159058_73b9_44ce_8b43_d4fb3c43aa8a",
                                        ClassId: "d02dc3b6-d709-46f8-cb72-452fa5e082b8",
                                        PropertyToDisplay: {DisplayName:"DisplayName"},
                                        Scoped: true
                                    },

    At first glance this looks very promising, when I open up my change request, it show the correct object picker, when I click add it shows the correct scoped class, when I select a release it commits. But then a new issue starts. On the portal I can see in the history that the correct relation is commited, but my CR in the portal does not want to load anymore. I get an error in the controller.js file on line 314:

    if (currentItem.BaseId != item.BaseId && currentItemEvent.action=="add") return; //This will be only used when adding new items

    with error message: Unable to get property 'BaseId' of undefined or null reference

    If I open a CR that does not have that relationship with a RR, the CR opens correctly in the portal. For some reason displaying the newly related RR crashes the portal.

    Additional info (my custom relationship xml):

    <?xml version="1.0" encoding="utf-8"?><RelationshipType ID="SubmittedOn" Accessibility="Public" Abstract="false" Base="System!System.Reference"><Source ID="Source_0da6e75c_d762_4098_ac38_ca78e47e771d" MinCardinality="0" MaxCardinality="2147483647" Type="Alias_7e4e2a4e_521e_48e6_9a84_ce0ae202fb45!System.WorkItem.ChangeRequest" /><Target ID="Target_61159058_73b9_44ce_8b43_d4fb3c43aa8a" MinCardinality="0" MaxCardinality="1" Type="Alias_9363af5a_764c_4374_b040_bfc99de0914f!System.WorkItem.ReleaseRecord" /></RelationshipType>

  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    Good info: SubmittedOn Relationship defined with Source is Change Request (0:many) and Target is Release Record (0:1).

    Your form on the portal is using the correct custom projection type with your relationship in it otherwise you wouldn't have got it this far, the form would never load in the first place.

    After looking at the Cireson Incident.js code located in "C:\inetpub\CiresonPortal\Scripts\forms\templates", it appears we could try one other thing:
    {
    name: "WorkItems",
    type: "multipleObjectPicker",
    PropertyName: "RelatesToWorkItem",
    ClassId: "f59821e2-0364-ed2c-19e3-752efbb1ece9",
    PropertyToDisplay: {Id:"Id",Title:"Title","Status.Name":"Status", LastModified:"LastModified"},
    SelectableRow: true,
    SelectProperty: "Id"

    },
    Obviously this code works for Cireson on WorkItems, so maybe it'll work for you?
  • Mark_BlokMark_Blok Partner IT Monkey ✭
    I added the two lines to the custom form def but the error is still the same unfortunately..
  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    Did you also add the additional parameter Id:"Id" within PropertyToDisplay???

    If that doesn't help then I think this needs to be reported to Cireson as this core functionality should be present and isn't.  They should be able to easily replicate your issue and see for themselves.
  • Mark_BlokMark_Blok Partner IT Monkey ✭
    Yes, I also added the ID in the propertytodisplay section. I will report this to support. hopefully they can help me out. When I have a solution I will report it here. Thanks for the help Conner!
  • Mark_BlokMark_Blok Partner IT Monkey ✭
    Answer ✓
    Together with John Doyle we tried to troubleshoot the issue. It seems that the object picker is indeed scoped to config items and therefor cannot be used. The multiple object picker should work, only we found that when used with a custom relation with 0:1 functionality it breaks. It expects an array of objects but receives a single object instead. Other than these two their are currently no object pickers available so this config is currently not possible in the portal. John has forwarded this to the dev team and they will try to find the best solution. For now the workaround is to change my relationship to 0:many and handle situations where user relate more than one Release record differently, I suppose I will create a runbooks to send an email to the user when this happens.
  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    That's a fantastic summary of this issue, thank you for the information @Mark_Blok and the ugly workaround of needing to use a many:many relationship for now, Cireson does need to fix this as I'm sure countless others have tried in the past and just gave up.
Sign In or Register to comment.