How to apply filter in configuration item -incident

chanikya
Tera Guru

Hi,

some one kindly suggest me how to apply filter on Configuration item field of incident- That filter condition but be reflect on only Incident

need to show below classes only

- Servers
- Computer
- Chromebooks
- Database Instance
- Router
- Switch
- VPN
- Load Balancer

1 ACCEPTED SOLUTION

Hi,

Yes, you'd want to add your query that you created and copied, to the same "return" result in this script include. The first main if statement would apply be for incident, the second main if statement you can leave alone as that's for requests and request items.

So you'd want to add it to what is already there so like:

if (type == 'Software') {
return 'ref_cmdb_ci_spkg.u_importance!=^sys_class_name=cmdb_ci_spkg';
} else {
return ''; <----------- add it here

For example. Otherwise for that first entry, Software, that has it's own reference qualifier it seems.

I don't know your instance requirements, etc. but you'd want to add the reference qualifier where you need it.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

8 REPLIES 8

Allen Andreas
Administrator
Administrator

Hi,

You can right-click on the configuration item label and choose "configure > dictionary" then scroll to the bottom related lists and in the dictionary override, look for a record for incident if it's already there, if so, open that record and add your reference qualifier in that field. If not, you can create one and add the reference qualifier there.

find_real_file.png

find_real_file.png

Replace this highlighted portion with the other query as shown in the last screenshot below):

find_real_file.png

Example, create filter:

find_real_file.png

Copy the query the place in that reference qualifier field:

find_real_file.png

find_real_file.png

 

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Aillen,

i just checked at Dictionary overrides side, 

we have one record with incident , so how to apply filter query here ? along with this existing script ?

find_real_file.png 

Hello,

Hopefully my above reply was at least Helpful.

As far as adding a custom reference qualifier in addition to that script, you wouldn't be able to do that unless you edit that script include mentioned in that field. Your requirements are changing and different from out-of-box, so you wouldn't be using the out-of-box qualifier at that point.

Please mark reply as Helpful/Correct, if applicable. Thanks!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

yes, we are not using OOB qualifier here.

do i have to modify in script include side ?

 

var RefQualifierUtil = Class.create();
RefQualifierUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {

type: 'RefQualifierUtil',
getCIdQualifier: function(type, table) {
if (JSUtil.notNil(type)) {
if (type == 'Software') {
return 'ref_cmdb_ci_spkg.u_importance!=^sys_class_name=cmdb_ci_spkg';
} else {
return '';
}
} else {
if (table == 'sc_req_item' || table == 'sc_request') {
return 'ref_cmdb_ci_spkg.u_importance!=^sys_class_name=cmdb_ci_spkg';
} else {
return '';
}
}
}
});