How to exclude OOB notifications for some catalog items

Premkumar1
Giga Expert

How to exclude OOB notifications for some catalog items. I tried SysID is not in conditions but it is not working.

Notification is configured in Sc_request Table. Any help will be highly appreciated

1 ACCEPTED SOLUTION

You will need to change script as following, also add proper SYS IDs

answer = checkResult();

function checkResult(){		
	var gr = new GlideRecord('sc_req_item');
	gr.addEncodedQuery('request='+current.sys_id+'^cat_itemIN060f3afa3731300054b6a3549dbe5d3e,060f3afa3731300054b6a3549dbe5d3e');  //Replace with a comma separated list of your catalog item SYS IDs
	gr.query ();
	if (gr.next())	
	    return false;
	else
	    return true;	
}

View solution in original post

13 REPLIES 13

You will need to change script as following, also add proper SYS IDs

answer = checkResult();

function checkResult(){		
	var gr = new GlideRecord('sc_req_item');
	gr.addEncodedQuery('request='+current.sys_id+'^cat_itemIN060f3afa3731300054b6a3549dbe5d3e,060f3afa3731300054b6a3549dbe5d3e');  //Replace with a comma separated list of your catalog item SYS IDs
	gr.query ();
	if (gr.next())	
	    return false;
	else
	    return true;	
}

Can we use the same script on Approval table's notification?

I tried this script but it wasn't working for Approval table's notification

 

MimiK
Tera Contributor

Hi @Alikutty A 

Thank you so much. The script works.

Regards

mmk

Premkumar1
Giga Expert

Thanks Its working