Home Service Manager Portal Feature Requests
We appreciate you taking the time to vote and add your suggestions to make our products awesome! Your request will be submitted to the community for review and inclusion into the backlog.

We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.

For more information around feature requests in the Cireson Community click here.

Filter to reduce shown CI´s

Suleyman_OzdenSuleyman_Ozden Customer Advanced IT Monkey ✭✭✭

I am getting negative feedback on the amount of "Configuration Item" class that is being listed when you search in the affected/related CI list.


Its a minor request but ideally it would be nice if we could have a filter that showed the same as in the "Configuration Item" class filter, but with the exception of user CI´s.



7 votes

Submitted · Last Updated

Comments

  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    edited November 2017

    If you are willing to change the original cireson code base the following might help you: 

    adjustments are made in the "\Scripts\forms\predefined\affectedItems.js" file (or relateditems.js)

    configItemDataSource: new kendo.data.DataSource({
                        serverFiltering: true,
                        transport: {
                            read: {
                                url: function (data) {
                                    var configItem = (data.filter.filters.length > 0) ? data.filter.filters[0].value : "aa%";  // filter should be set because it took some time to load 1000 of items - this is no limitation because if you type some characters in the drop down list, the filter be be adjusted ;-)


                                    // return "/api/V3/Config/GetAffectedItemsList?itemFilter=" + configItem;  //original call
                                   return "/api/V3/Config/GetConfigItemsByAbstractClass?userId="+ session.user.Id + "&isUserScoped=false&searchFilter=" + configItem + "&objectClassId=7ad221e0-e4bb-39a8-6514-33b60bba46f5";   // with this line you can use abstract classes,too e.g. "system.device" which can also be used to limit the amount of ci's what are shown
                                },
                                dataType: "json"
                            }
                        }
                    }),

     

    if you want to limit the search results in the "search" box (same file as above):

    searchConfigItem: function () {
                        var popupWindow = objectPickerPopup.getPopup("7ad221e0-e4bb-39a8-6514-33b60bba46f5", "DisplayName,Path,Status", null, null, true); // guid for system.device 
                        popupWindow.setSaveCallback(function (object) {
                            addAffectedItem(object.BaseId);
                        });
                        popupWindow.open();
                    },

    regards


  • Suleyman_OzdenSuleyman_Ozden Customer Advanced IT Monkey ✭✭✭

    Hi Roland. Thank you!

     I am not a fan of changing the original code. Could this be used in custom.js instead?

  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
  • Suleyman_OzdenSuleyman_Ozden Customer Advanced IT Monkey ✭✭✭
    Right, seem to address the same. I will close this request. Just want to give Roland a chance to get back on my question.
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭

    Hi,

    yes it seems to be possible ;) (quick test on 8.2 Portal only)

    if you clone the whole "controller" (e.g. copy the affectedItems folder to a new folder in the SAME parent directory (/scripts/forms/predefined ...)), modify the js file, and then add the following to your custom.js

     $(document).ready(function ()
     {
     
      require(["/Scripts/forms/predefined/yourcontrollerfolder/yourcontrollerscript.js"], function (controllerfunction) {
      window.controllerfunction=controllerfunction;
     });

    })

    to use the new controllerfunction - you have to adopt the incident.js or servicerequest.js (json templates for workitems)  which could be copied to the customspace folder (!)) and replace the following line with your "Controller"

    {
                                name: "AffectedConfigurationItems",
                                type: "youraffectedItemsController"
                            }

    as said before, this was just just quick tested on 2016 version of the portal with IE in a dev environment

    regards


    p.s.

    with this approach you can define even a different layout of the Controller in the html file (add further drop down menus etc)

  • Martin_StrbavyMartin_Strbavy Member IT Monkey ✭
    I was searching for something like this. And you helped me a lot, but is it possible to return multiple independent classes? For example, I am trying to filter it just for: Cireson.AssetManagement.HardwareAsset, Cireson.AssetManagement.SoftwareAsset and class which holds Databases (imported from SCOM).

    I am able to customize script to filter only one class  :/ 

    So if someone is able to help, I will really appreciate it.

    Martin
Sign In or Register to comment.