cmdb_ci reference qualifier on sc_task

Chris Petrone
Tera Expert

Hello,

I am struggling to filter out CIs from the cmdb_ci field on sc_task table.

I have Principal Classes selected in my environment,

The Configuration item field's reference qualifier is: javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

 

OOB there are Dictionary Overrides for Incident, Problem, Change. They use overrides of: javascript:new TaskUtils().getConfigurationItemFilter(current);

 

This same override does not seem to work for other tables, sc-task, demand, etc. I am wondering what I need to filter out sc_task the same way to only list Principal Classes?

3 REPLIES 3

Slava Savitsky
Giga Sage

The problem is that the list of task types, for which the operational status filter is applied, is hardcoded in the CONSTANTS.OPS_FILTER_CLASSNAMES property in the TaskUtilsSNC script include. This is also where getConfigurationItemFilter function used by your reference qualifier is defined. You can override the value of the constant and, if needed, also the function definition in TaskUtils script include that extends TaskUtilsSNC.

What would be the recommended way of proceeding with minimal-0 changes on the script include? Just create my own override qualifier with each individual Principal class?

Right, you can simply create your own script include with your own query logic and call it from the dictionary overrides as needed.