Prevent "Request was opened" notification to trigger for a particular catalog item.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 10:08 AM
My requirement is to prevent "Request was opened" notification to trigger for a particular catalog item.
I have a variable on the catalog item called add user. If user select "remove" from add user variable, the notification should not triggered. Below is the code I use. The issue is that the notification are not triggered again for all other catalog item again but only trigger for the one reference on the script.
answer = checkResult();
function checkResult() {
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery('request=' + current.sys_id + '^cat_item=f8d13ba7c071f950fa34f24c403a30ce'); //sys id of VIP user update catalog item
gr.query();
if (gr.next())
if(gr.variables.add_user == "remove"){
return false;}
else
return true;
}
0 REPLIES 0