Filter Service Offerings by Operational status - Reference qual

Kasia5
Tera Contributor

Hi,

I want to add one more filter to Reference qual for field Service offering in Incident form. Now it looks like:

find_real_file.png

And I was trying to add operational_status=1 in the beginning or at the end but it doesn't work..

I was trying with:

javascript: 'operational_status=1' : ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci)

javascript: 'operational_status=1' + ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci)

javascript: ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci) + 'operational_status=1' 

javascript: ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci) : 'operational_status=1' 

 

Thanks in advance for help how can I achieve this

3 REPLIES 3

Shane41
ServiceNow Employee
ServiceNow Employee

Hi Kasia,

Have you tried adding a ^

javascript: ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci) : '^operational_status=1' 

Is the FilterServiceByCI a custom script or OOTB? Does it return a query string?

Hope this helps

Shane

Kasia5
Tera Contributor

Thank you for response. I was trying with your solution but it also doesn't work 😞

FilterServiceByCI is a custom script I think, when CI in another field is selected then in field Service should be only service offerings related to this CI

Kasia5
Tera Contributor

Ok, I found the solution 🙂 There should be:

javascript: ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci) + '^operational_status=1' 

instead of:

javascript: ['incident', 'problem','change_request'].indexOf(current.sys_class_name + '') == -1? '' : FilterServiceByCI(current.cmdb_ci) '^operational_status=1'