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

@Ankur Bawiskar 

 

Tried using this way. 

PratikshaKC_0-1749721209393.png

But it still shows duplicate values

PratikshaKC_1-1749721234910.png

 

@Pratiksha KC 

how are you knowing it's duplicate?

why same CI name is there in cmdb_ci table?

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 

They have different versions of CI's 

@Pratiksha KC 

what do you mean by different versions of CIs?

are those separate records i.e. with separate sysIds?

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 

 

Yes, they have diff sys_id 

PratikshaKC_0-1749723308589.png