Dictionary override on configuration item for sc_task table isn't working to filter choices

RitaS
Tera Guru

We have configuration item as a field on incident, problem, and change.  The choice list is filtered to only include CIs from principal classes.  We are now capturing configuration item on sc_task records and the choice list is showing all CIs.  I've tried adding a dictionary override for the sc_task table, using the reference qualifier override.  Looking at incident override, it uses TaskUtils script include which is an extension of TaskUtilsSNF.  The OPS_FILTER_CLASSNAMES value includes only  incident and problem tables as the task types used in the filter.  My thought was that I needed to add sc_task to the task types.  I first tried creating a new script using the same script content but with the addition of the sc_task table.  I also tried setting the values in TaskUtils script to override TaskUtilsSNF.   Neither way works, I still see all of our configuration item records in the choice list when selecting from a service catalog task record.  

 

Here is the current dictionary override: 

RitaS_0-1748632731371.png

And the reference qualifier override for sc_task:

RitaS_3-1748633898793.png

 

 

Here is my override script include in TaskUtils:

RitaS_2-1748633154393.png

 

I still see over a million configuration items in the choice list where incident and change are restricted to the principal class records, around 40,000 records.  

Am I missing something else that needs to be set for this to work with sc_task?

1 ACCEPTED SOLUTION

RitaS
Tera Guru

Well this is really frustrating.  Just found this KBA:  https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0787996

It states that 

"The reference qualifier of the cmdb_ci field does not work when trying to override the task table's cmdb_ci field's reference in the catalog task.
Any value placed into the reference qualifier field in the dictionary override for catalog task gets ignored."

And then it says that they have decided not to fix it.  So I've basically wasted a bunch of time on something that doesn't work and apparently never will. 

View solution in original post

7 REPLIES 7

YaswanthKurre
Giga Guru

Hi Rita,

 

Open the TaskUtilsSNC script include from TaskUtils and copy the function from getConfigurationItemFilter() and override this function in TaskUtils.

 

This will resolve the issue.

 

Please mark this as helpful and correct if this helps you.

 

Thanks,

Yaswanth

 

RitaS
Tera Guru

Thanks for the quick response. I copied the function from TaskUtilsSNC and pasted in the TaskUtils script include.  Here is the content now:

RitaS_0-1748638727292.png

I gave this a try, it still does not filter correctly.  Since this is an override to TaskUtilsSNC I'm not sure why copying the function intact from the original script would do anything different.  Let me know if I've missed something.

Hi Rita,

 

Do not use the same function name as it might impact in other places where it is being used.

 

So create your own function with data you need to be passed and also replace the function name in your dictionary override.

Please mark this as helpful and correct if this helps you.

 

Thanks,

Yaswanth

 

RitaS
Tera Guru

The other odd thing is that there is an OOTB reference qualifier override built for change that filters correctly even though the change_request table isn't listed in the OPS_FILTER_CLASSNAMES constant.