Disable notifications for catalog items

Pintu2
Tera Expert

I have a catalog item which doesn't need Request(sc_request) notifications.How can I exclude notifications for only 1 catalog item and include sc_request notifications for remaining catalog items?.

 

I want to add conditions like Item is not XXX then trigger notification in conditions under when to run tab in Notifications but for sc_request table notifications I can't pull Item(sc_cat_item) table catalog items.So by adding these conditions in notifications I assuming I can exclude 1 catalog item and for remaining catalog items all the sc_request notifications will be triggered.Is there any other way I can achieve this ?.I know I can create a Item field on sc_request and add conditions but just trying to explore if there is any alternate way to do this .

Thanks in advance

1 ACCEPTED SOLUTION

Bharath40
Giga Guru

Write below code in advanced condition of notification

var gr = new GlideRecord("sc_req_item");

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

gr.addQuery("cat_item.name", 'catalog item name');

gr.query();

if (gr.next()) {

answer = false;

}

else{

answer = true;

}

View solution in original post

3 REPLIES 3

Bharath40
Giga Guru

Write below code in advanced condition of notification

var gr = new GlideRecord("sc_req_item");

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

gr.addQuery("cat_item.name", 'catalog item name');

gr.query();

if (gr.next()) {

answer = false;

}

else{

answer = true;

}

Hey Bharath,

Do you have an idea how we can accomplish this by adding a check box on sc_cat_item on the catalog item is designed? 
So when we design the catalog item we check if notifications need to be sent for that item or not.
Because we have multiple request items we want to do that with and we don't want to add them to the script 

Hello Taha,

You can add a checkbox on maintain item something like Notification Not Required and check that for all SCI's that you don't want to send notifications.

Update the script to add one more query

 

var gr = new GlideRecord("sc_req_item");

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

gr.addQuery("cat_item.name", 'catalog item name');

gr.addQuery("cat_item.notification_notreq", 'true'); // if checked don't send notification

gr.query();

if (gr.next()) {

answer = false;

}

else{

answer = true;

}

 

Thank you