Sagar Pagar
Tera Patron

Hi,

Try this script - It will be helpful for you. Once you added this, make sure to add this Related list on Catalog task form.

(function refineQuery(current, parent) {

var queryString = "table_name=sc_req_item^table_sys_idIN" + parent.getValue("request_item");
	
	var gr = new GlideRecord("sc_task");
	gr.addQuery("sys_id", parent.getValue("request_item"));
	gr.query();
	while (gr.next()) {

		queryString += "," + gr.sys_id.toString();
	}
	current.addEncodedQuery(queryString);

})(current, parent);

 

Thanks,

Sagar Pagar

The world works with ServiceNow