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

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

please check the thread below, it will show you how to do that:

https://community.servicenow.com/community?id=community_question&sys_id=62d4cfe9dbd8dbc01dcaf3231f96...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

In when to send part of the notification you have to write a advance script where it will check its RITM and item.

 

Use this script:

 

var gr = new GlideRecord('sc_req_item');

gr.addQuery('request',current.sys_id);

gr.addQuery('cat_item','YOUR ITEM SYS ID'); //Item for which you dont want this notification

gr.query();

if(gr.next()){

answer = false;

}else

{

answer = true;

}

 

THanks,
Ashutosh

Alikutty A
Tera Sage

Hello,

Which notification are you taking about? You will need to notification email Condition script and then query on RITM and then and check for the catalog item and trigger it.

You can follow these steps to achieve this requirement.

Open your notification and switch to Advanced view and then add the following Script in it.

answer = checkResult();

function checkResult(){		
	var gr = new GlideRecord('sc_req_item');
	ritm.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;	
}

 find_real_file.png