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.

Prevent "Request was opened" notification to trigger for a particular catalog item.

Ken61
Giga Guru

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