Change _task table : reference qualifier

chandan2212
Tera Contributor

Hi Team ,

 

In the change _task table , CI is the reference qualifier  and advanced  reference qualifier this script is written javascript: ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1? '' : 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()

 

but i am not able to understand the script , anyone help me.to debug the script  

 

Thanks ,

Chandan

1 ACCEPTED SOLUTION

@chandan2212 

see if the reference qualifier is satisfying or not.

Also check if any dictionary override is added for change_task and has some additional filter on CI field.

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@chandan2212 

it clearly says it will show CI on inc/prb based on the operational_status field

what's your question?

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 one of the user created change request and after passing the steps  these ctask generated automatically , in that two ctask CI name is not populating for the parent one or we are not able to select the parent CI also .

 

Thanks and Regards,

Chandan

 

@chandan2212 

see if the reference qualifier is satisfying or not.

Also check if any dictionary override is added for change_task and has some additional filter on CI field.

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

SindhuC
Tera Contributor

Hi Chandan,

Let me help clarify the script used in the advanced reference qualifier:

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

 

Explanation:
• ['incident', 'problem'].indexOf(current.sys_class_name + '') == -1
• This checks if the current record’s class name is not incident or problem.
• If it’s not in the list, it returns -1.
• If the condition is true (== -1), the script returns an empty string — meaning no filter is applied.
• If the condition is false (i.e., the current class is incident or problem), it applies a filter:
• 'operational_statusNOT IN' + new OpsStatusFilter('cmdb_ci').by('CreateTask').join()
• This constructs a dynamic filter that excludes certain operational_status values, using a custom filter utility (OpsStatusFilter) specifically for CreateTask context.

In Summary:
• If the task belongs to incident or problem, it applies a filter to exclude certain CI statuses.
• Otherwise, it does not restrict the CI field.

Thanks,

Sindhu