How to stop email notification for a catalog item when RITM is closed complete notifications is triggering from sc_req table notification?

sai190
Tera Contributor

Hi 

Can anyone help me with the solution of ' stopping an email for a catalog item' when the RITM is closed, notification is getting triggered from sc_ req table, iam not able to select the name of the catalog item in the conditions? Can anyone help me with the solution please?

9 REPLIES 9

Oh ok , try this in advance condition of notification

find_real_file.png

Code:

var e = new GlideRecord('sc_req_item');
e.addQuery('sys_id', current.request);
e.addQuery('cat_item', 'sys id of catalg item');
e.query();
if (gr.getRowCount() > 0)
    answer = false;
else
    answer = true;
Please hit like and mark my response as correct if that helps
Regards,
Musab

Sorry one small mistake I made I have corrected below

var e = new GlideRecord('sc_req_item');
e.addQuery('request', current.sys_id);
e.addQuery('cat_item', 'sys id of catalg item');
e.query();
if (e.getRowCount() > 0)
    answer = false;
else
    answer = true;

 

Please hit like and mark my response as correct if that helps
Regards,
Musab

Aman Kumar S
Kilo Patron

You can use advanced script in your notification:

var scReq = new GlideRecord("sc_req_item");
scReq.addQuery('request', current.getUniqueValue());
scReq.addQuery('cat_item', 'sys_id_of_catalg_item');
scReq.query();
if (scReq.next()){
    answer = false;
}
else{
    answer = true;
}]
Best Regards
Aman Kumar

@sai

Check the correct script above in my reponse

Best Regards
Aman Kumar

Mohit Kaushik
Mega Sage
Mega Sage

Hi Sai,

You need to go to your notification on sc_request table and in the advanced condition section you can write the below script:

var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request', current.sys_id);
ritm.addQuery('cat_item', 'Sys_id of catalog item');
ritm.query();
if (ritm.nex()) {
    answer = false;
} else
    answer = true;

 

Please mark this as correct and helpful if it resolved the query or lead you in right direction.

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)