Reference qualifier on CI in Record Producer

Pratiksha KC
Tera Guru

We wants to achieve reference qualifier for configuration Item variable based on two conditions: 

 

1. if category selected as software it should show the records from table - cmdb_ci_service_discovered and cmdb_ci_service_auto. 

 

(For this we have wrote advance qualifier , it is working fine -
javascript:current.variables.category=='software' ? 'sys_class_name=cmdb_ci_service_discovered^ORsys_class_name=cmdb_ci_service_auto' : '' ) 

 


2. The field CI on the RRP should only show records from Primary classes.

In backend, on incident we have reference qualifier For CI - javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

 

How can we achieve this?

PratikshaKC_0-1749660882433.png

 

1 ACCEPTED SOLUTION

Pratiksha KC
Tera Guru

Got the solution - 

javascript:current.variables.category == 'software' ? 'sys_class_name=cmdb_ci_service_discovered^ORsys_class_name=cmdb_ci_service_auto' : new TaskUtils().getConfigurationItemFilter({sys_class_name : 'incident'})

View solution in original post

17 REPLIES 17

@Pratiksha KC 

then it's correct as they are different records

If all of those are with operational status != 6 then it means your else part of ref qualifier is working fine.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

But one of them salesforce is satisfying the condition. 

In backend on incident, it is showing one salesforce value in CI 

 

Do we need to add anything into variable attribute?

PratikshaKC_0-1749724373331.png

 

Pratiksha KC
Tera Guru

Got the solution - 

javascript:current.variables.category == 'software' ? 'sys_class_name=cmdb_ci_service_discovered^ORsys_class_name=cmdb_ci_service_auto' : new TaskUtils().getConfigurationItemFilter({sys_class_name : 'incident'})