Home Analyst Portal

Setting up a New Field in the Incident Form

Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
Hey guys,

I'm trying to follow various guides and things to set up a new "Location" field on our customised Incident form. But I've fallen at the final hurdle and I can't work out what I've done wrong... Any advice would be gratefully received!

At the moment, I've got this:


So here's a summary of what I've done so far (please forgive any bad practices followed as I'm extremely new at this!!):

1.) Created an unsealed management pack called NSLocationListMP containing a list called NSLocationListMP.SiteList with a display name of NS Site List
2.) Sealed the management pack - imported the sealed management pack into the Service Manager console, also saved sealed MP into Authoring Tool Library folder
3.) Added the list values in Library > Lists (saved the values in an unsealed management pack called NS Locations Value MP)
4.) Opened the SM Authoring Tool, selected Incident from All Management Packs in the Class Browser. Right clicked Incident, selected View
5.) Right clicked Incident under Classes in the MP Explorer and chose Extend
6.) Saved extension in a new unsealed MP titled NS.LocationFieldExtension.ManagementPack
7.) Clicked Create Property, called the new property Location, set data type to List and selected NS Site List when prompted
8.) Saved NS.LocationFieldExtention.ManagementPack, then imported it into SM Console.
9.) Edited Incident.js in our CustomSpace folder (we have existing customisations from before I worked here) added the following line:

{ DataType: "Enum", PropertyDisplayName: "Location", PropertyName: "Location", EnumID: '55d33749-982f-440f-3b28-e3a70bfd5501', Required: false },

I got the EnumID by running a PowerShell command: Get-SCSMEnumeration -name NSLocationListMP.SiteList | Format-Table Name, ID
I also added a comma to the end of the previous line.

Any ideas please? I'm really at a loss...

Best Answer

  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    Answer ✓
    So for anyone eager to know what I was doing incorrectly, it was two-fold:

    1.) I was setting the PropertyName in the incident.js file to the wrong thing. I needed to set it to the same value as is shown in the Extensions tab on an Incident in the Service Manager console.
    2.) Quite literally a mistype: I was typing EnumID instead of EnumId, not realising that uppercase D was the cause of my troubles.

    Oops! Learning lots, thank you for everyone's help!

Answers

  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    I also added custom lists. If I remember correctly. The list must be unsealed but the class extension must be sealed. Then you go to lists in the SCSM console and populate that list with your values.
    It seems like you are targeting the EnumId so that will be ok. I prefer to use the SCSM Entity Explorer as it gives me all the info I need.

    Also, you need to restart the cache builder to get the list values into the portal.
  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    edited February 2019
    Hi Gerhard, thanks for your reply. Yeah that's right, if I understand things correctly, my class extension is NSLocationListMP (which is sealed and contains the actual list), and the list values are stored in NS Locations Value MP (which is unsealed).

    I followed this guide here and used the tool attached to the guide to create NSLocationListMP before sealing it: 
    https://blogs.technet.microsoft.com/manageabilityguys/2013/05/03/creating-service-manager-lists-with-the-service-manager-list-maker-tool/

    I've restarted the cache builder, then (probably overkill), rebooted our SCSM server, but to no avail unfortunately.

    Edit: Sorry I think I see what you mean - The MP containing the list itself (NSLocationListMP) cannot be unsealed otherwise you can't reference it when creating the class extension. The MP that holds the list values (NS Locations Value MP) can be unsealed though so I can add/remove values later down the line.

    I have sealed my class extension MP (NS.LocationFieldExtension.ManagementPack) and re-imported it. Have restarted the cache builder and am crossing my fingers!
  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    No joy even after importing a sealed version of my class extension MP and restarting Cache Builder and IIS.

    Does anyone have an end-to-end guide on how to add a custom enum list to the Incident form in Cireson's Analyst Portal? Something similar to this but specifically referencing a List, not a string or tick box:
    https://cireson.com/blog/add-custom-fields-cireson-portal-service-manager/

    At this point, tempted to just undo everything I've done and start from scratch, but at the moment I'm trying to do something I've never done before using bits and pieces of information I can find from multiple sources online.
  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    @Matt_Overton have you restarted your apppool ? the enums get loaded for the portal when the apppool starts
  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    Thanks Jeff, have given this a go just now but no joy just yet. I wonder if I'm getting the EnumID correct... 

    I can see three different possible options so I'm not sure which one is the one I want.
    Option 1 is given to me by Powershell:


    Option 2 is via the Entity Explorer (thanks Gerhard):


    Option 3 is in the Entity Explorer again, but in the Class Properties tab on the "Location" row (which is the new property I've created):


    So which one should I be using when adding the code to Incident.js in the CustomSpace folder to make it work?
  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    Ok, this is what I have.

    MP's

    NWU.List.Campus (Sealed)







    Entity Explorer


    PS


    Incident Form


    PageForm.ViewModel

  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    Thanks @Gerhard_Goossens that's really helpful. I've gone back to the drawing board so I can try and emulate something similar.

    Just a question though, what's the PageForm.ViewModel bit at the end? I've not come across that, could that be why it isn't working for me, am I missing a step?
  • Gerhard_GoossensGerhard_Goossens Customer Advanced IT Monkey ✭✭✭
    edited February 2019
    If you go into the portal into developer tools and type that into the console screen, it gives you all the raw data of the work item. Just make sure you are in the work item type that you want to add the list to. 


  • Matt_OvertonMatt_Overton Customer Adept IT Monkey ✭✭
    Answer ✓
    So for anyone eager to know what I was doing incorrectly, it was two-fold:

    1.) I was setting the PropertyName in the incident.js file to the wrong thing. I needed to set it to the same value as is shown in the Extensions tab on an Incident in the Service Manager console.
    2.) Quite literally a mistype: I was typing EnumID instead of EnumId, not realising that uppercase D was the cause of my troubles.

    Oops! Learning lots, thank you for everyone's help!
Sign In or Register to comment.