Home Analyst Portal

Customize CI Search

Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭
Hello Cireson community!  My organization requires that a business service is related to each CR.  My goal would be to have the Configuration Item picker scoped down to just business services.  Our users rarely use the CI field for anything but these services, so if I could filter it, at least in this one area, the CR form would have a perfect flow for us.

Anyone know of a way to accomplish this?


Best Answer


  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    In the portal, you could create an additional single- or multi-object picker in changerequest.js that uses the affected (or related) CI relationship, but is scoped to the Business Service class.  You mention that your users do not typically use the CI picker for other CI's, so you could just comment out the out-of-box CI picker after adding this one.

    This article in the Cireson support KB is the starting point for explaining how to do this.
  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭
    Thanks for the advice Tom.  That sounds good for what we're trying to do. 

    What I did so far was move the out of the box "relateditems" section to the general tab.  But I don't think I can make this required. 

    I see in ChangeRequest.js where I can set required on something like a userpicker, again exactly what I need. 

    Your suggestion makes complete sense, but I have no idea how to perform the execution.  Any tips on where to start for a newbie?
  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭

    Let me elaborate.  I'm trying something along these lines, but it's not working, as expected since I made it.  Still looking for an example post out there, but coming up empty.

    columnFieldList: [
    { DataType: "ObjectPicker", PropertyDisplayName: "Business Service", PropertyName: "DisplayName", ClassID: "b2a806a6-87f6-0bc9-da74-c27e9ab5a5d7", Required: true },
  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭

    Thanks again for your assistance.  I was able to get this working by adding this to ChangeRequest.js

    columnFieldList: [
    { DataType: "ObjectPicker", PropertyDisplayName: "Business Service", PropertyName: "RelatesToConfigItem", ClassId: "b2a806a6-87f6-0bc9-da74-c27e9ab5a5d7", Required: true }

    And there was much rejoicing!
  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭
    Well, it seemed like I had it, but now if you go through the rest of the CR, into the MAs and RAs, and try to update them, it complains that a required Business Service was not included, even though the field has not changed.

    I can go over to the Console and update the work item without issue. 

    So, I went back and edited ChangeRequest.js and removed the required property from the field, and then I can submit changes again.

    Can anyone identify why I can submit the CR with the field populated and set to required, but cannot update MAs or RAs with it set that way?
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    It has been a while since I have done this on a form, so my recollection here is not perfect, and I invite corrections from others.  However, it sounds as though the change you made is saving the related service, but not recognizing it on open.

    Some ideas:
    • On a new ticket, add a service to your new control, but before you save it, press F12 to open the browser console.
    • Type pageForm.viewModel.RelatesToConfigItem[0] to bring up the object that you just added.
    • It may put the object on one line, so click the triangle to the left and expand it out so that you can see all the properties.
    • Look for the ClassTypeId property.  Does it match the class that you defined above in your control?  Note the answer here.
    • Click Apply (NOT save).  Does the service still appear on the form?  If so, repeat the steps above.  Does the class GUID (still) match?

    My theory here is that the object may be saving with a different (but still correct) class, which then does not appear in the form.  If true, some ways to solve it might be using a different (higher- or lower-level class that Service inherits from) class, or creating a type projection and using that relationship instead of the more generic RelatesToConfigItem.

  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭
    After reading your last post, I decided to take another look at that KB article that you linked about Type Projections and yes, that is what was needed to finally get this working.  Certainly, I have not done a lot of authoring yet, but that KB article was straightforward (as soon as I let myself understand the content and not get frustrated).

    After creating the type projection and importing the management pack, I edited the ChangeRequest.js form with the guid of the relationship added to the Change Request class.

    Now I can update the form without issue.  Not only did I get the exact results I was looking for, but I learned some valuable information on how to author in Service Manager.

    One more time, thanks again for the patience and the help.
Sign In or Register to comment.