Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Thanks alikutty for the response .I tried this but it is not working.

Can you paste the script used?

There is a typo in line

ritm.addEncodedQuery(

 

it should be

gr.addEncodedQuery(

 

Request Approved notification

I mean the condition which you have written, Did you replace those SYS_IDs with the SYS ID of your catalog items?