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
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.
Comments
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
Hi Roland. Thank you!
I am not a fan of changing the original code. Could this be used in custom.js instead?
https://community.cireson.com/discussion/2053/configuration-item-classes-admin-page#latest
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)
I am able to customize script to filter only one class
So if someone is able to help, I will really appreciate it.
Martin