CI Reference Qualifier on Incident Form

Michael M1
Giga Expert

I am not seeing the CIs I expect on the Incident form when I click the lookup icon next to the Configuration Item field, and I may want to change it. 

The current advanced reference qualifier (OOB) is set as below.
I am having trouble interpreting it. Can someone describe please?

javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

Following checks, if the table current name is incident or problem

['incident', 'problem'].indexOf(current.sys_class_name + '') == -1?

 

If the above condition is true, it queries all the CIs with operation status = OpsStatusFilter('cmdb_ci').by('CreateTask').join()

OpsStatusFilter is a script include and by is a function inside it. This function will return a list of operational status of cmdb_ci table.


Please mark this response as correct or helpful if it assisted you with your question.

Hi,

Have a question about this new Reference qual of the Configuration Item field, do you know how to add an additional condition that should work in "OR" in the OOTB one?

In details, this is the condition to be added:

'company='+current.account

I've tried already with this, but it's not working as expected:

javascript:'company='+current.account + '^NQ' + ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

Thanks a lot for your help.

Cheers

Alberto

I have similar requirement...let me know if you found any solution

I think we need to append additional qualification at the end of the existing qualification.

 

For example following is what worked for me:

javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join() + '^sys_class_name!=service_offering'