Home Analyst Portal
Options

Related Work Item Status Broken with Custom Incident.js

Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭
I submitted a ticket to Cireson for this, but after digging more I discovered that the reason for why Related Work Items in the Analyst Portal are showing a Status of [object Object] was due to the Incident.js I have in my CustomSpace folder.



When I rename/remove that file and reload the site, the Status shows correctly for any linked WIs.

However, I need to have the custom js file there because it is used to bring in customizations that we've added to our Incident form that are not there out of the box (Affected Asset Location, Affected Asset Room, Affected Asset Description)

When I first created this Incident.js file, I was using the example file that was located here:  \CiresonPortal\CustomSpaceExamples  Looking at that directory now, it appears that the new example file is different than what I was using and doesn't appear to contain any information about the "Related Items" tab.

This is what I have in my Incident.js file in the Related Items tab section if you think it would help troubleshoot:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*********/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /** TAB **/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*********/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: "RelatedItems",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; content: [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; customFieldGroupList: [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: "WorkItems",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: "multipleObjectPicker",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PropertyName: "RelatesToWorkItem",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ClassId: "f59821e2-0364-ed2c-19e3-752efbb1ece9",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PropertyToDisplay: {Id:"Id",Title:"Title",Status:"Status", LastModified:"LastModified"},<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SelectableRow: true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SelectProperty: "Id"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },


Best Answer

  • Options
    Geoff_RossGeoff_Ross Cireson Consultant O.G.
    edited October 2016 Answer ✓
    Hi Chris,

    There's a change to the way the multipleObjectPicker works in v6+. It can now pick up any property from a object in the view model and bring to the grid.

    For Enums, like Status, you therefore now have to specify you want the name property with 
    "Status.Name". So that whole picker object should look like 
    {
       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"
    }
    You have a couple of options.

    1. Go though all your form customisations, and add in the property name.
    2. Grab the new v6 OOB form files found in CiresonPortal\Scripts\forms\templates, copy these over the top of the ones in custom space and then re-modify as needed.
    3. Merge your custom with the new OOB ones. Probably just a case of copying any multipleObjectPickers from the OOB files to your customs ones - but you need to watch out for the java-script syntax.
    4. If its just this one multipleObjectPicker on just IR you are having a problem with, then just copy this code above into yours, replacing the equivalent section.

    Geoff

Answers

  • Options
    Geoff_RossGeoff_Ross Cireson Consultant O.G.
    edited October 2016 Answer ✓
    Hi Chris,

    There's a change to the way the multipleObjectPicker works in v6+. It can now pick up any property from a object in the view model and bring to the grid.

    For Enums, like Status, you therefore now have to specify you want the name property with 
    "Status.Name". So that whole picker object should look like 
    {
       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"
    }
    You have a couple of options.

    1. Go though all your form customisations, and add in the property name.
    2. Grab the new v6 OOB form files found in CiresonPortal\Scripts\forms\templates, copy these over the top of the ones in custom space and then re-modify as needed.
    3. Merge your custom with the new OOB ones. Probably just a case of copying any multipleObjectPickers from the OOB files to your customs ones - but you need to watch out for the java-script syntax.
    4. If its just this one multipleObjectPicker on just IR you are having a problem with, then just copy this code above into yours, replacing the equivalent section.

    Geoff
  • Options
    Chris_KeanderChris_Keander Customer Advanced IT Monkey ✭✭✭

    2. Grab the new v6 OOB form files found in CiresonPortal\Scripts\forms\templates, copy these over the top of the ones in custom space and then re-modify as needed.

    Geoff, you've been an amazing help today.  This was the solution I went with (I forgot about that folder and was only focused on the 'examples' folder, and it did the trick!
  • Options
    Geoff_RossGeoff_Ross Cireson Consultant O.G.
    You are very welcome.
Sign In or Register to comment.