Excluding a catalogue item from approval notification

RichardSaunders
Tera Guru

I have a requirement to send a different request approval notification only if the catalogue item is "Long term access to removable media"

So i need to be able to send the OOB Catalogue Approval Request notification for all request except "Long term access to removable media" and a new notification only for

So first things first, i want to stop the OOB firing for the removable media item...

OOB Notification: https://INSTANCE.service-now.com/nav_to.do?uri=/sysevent_email_action.do%3Fsys_id%3Df1fae7b6c0a8011b...

This notification is fired by the event request.approval.inserted, I have tried adding a condition below but the notification still fires.

find_real_file.png

Secondly i created a copy of this notification and switched the conditions round. This notification does not fire at all.

find_real_file.png

I'm sure i have used event and condition based notifications together before but can't understand why this is not triggering.

1 ACCEPTED SOLUTION

Hi Richard,



You can use the Notification email script to achieve this scenario.



Example:


find_real_file.png



find_real_file.png



(function runMailScript(current, template, email, email_action, event) {


                             


                              template.print('<p><font size="3" color="#999999" face="helvetica"><strong>');


                              template.print(gs.getMessage('Additional Details') + ':');


                              template.print('</strong></font></p>');


                              template.print('<font size="3" color="#999999" face="helvetica">');


                              template.print('<p>' + gs.getMessage('Requested by') + ': ${sysapproval.opened_by}</p>');


                             


                              if(current.sysapproval.sys_class_name == 'sc_request') {


                                                              template.print('<p>' + gs.getMessage('Requested for') + ': ${sysapproval.requested_for}</p>');


                              }


                              else if(current.sysapproval.sys_class_name == 'sc_req_item') {


                                                              template.print('<p>' + gs.getMessage('Requested for') + ': ${sysapproval.request.requested_for}</p>');


                              }


                             


                              template.print('<p>' + gs.getMessage('Approver') + ': ${approver}</p>');


                             


                              if(current.sysapproval.cat_item != '') {


                                                              if(current.sysapproval.cat_item.getDisplayValue() == 'Item NAME') {


                                                                                              template.print('<p>' + gs.getMessage('Requested Role') }</p>');


                                                              }


                              }


                             



Please mark correct or helpful.



Regards,


Parvinder


View solution in original post

4 REPLIES 4

sb1186
Kilo Guru

Hi Richard,



Couple of things you could check, not sure if you have already tried.



1) Try placing this item restriction in the condition filter on the notification instead of using it on the event.


find_real_file.png


2) I can see that there are 2 OOB Catalog Approval Request notifications, i.e. with the same name, though triggered on different events. Make sure you are trying to update the one with the event request.approval.inserted.


find_real_file.png


Let me know if you have success.



PS: Mark this answer as Correct if it solved your query or hit Like/Helpful depending upon the usefulness of the response.



Regards
Supriya Bisht


Hi Supriya,



Thanks for the response, this is what i have already tried, the screenshots in my original post were taken from the notification itself. Here's is another screenshot showing event and the table.


find_real_file.png


Hi Richard,



You can use the Notification email script to achieve this scenario.



Example:


find_real_file.png



find_real_file.png



(function runMailScript(current, template, email, email_action, event) {


                             


                              template.print('<p><font size="3" color="#999999" face="helvetica"><strong>');


                              template.print(gs.getMessage('Additional Details') + ':');


                              template.print('</strong></font></p>');


                              template.print('<font size="3" color="#999999" face="helvetica">');


                              template.print('<p>' + gs.getMessage('Requested by') + ': ${sysapproval.opened_by}</p>');


                             


                              if(current.sysapproval.sys_class_name == 'sc_request') {


                                                              template.print('<p>' + gs.getMessage('Requested for') + ': ${sysapproval.requested_for}</p>');


                              }


                              else if(current.sysapproval.sys_class_name == 'sc_req_item') {


                                                              template.print('<p>' + gs.getMessage('Requested for') + ': ${sysapproval.request.requested_for}</p>');


                              }


                             


                              template.print('<p>' + gs.getMessage('Approver') + ': ${approver}</p>');


                             


                              if(current.sysapproval.cat_item != '') {


                                                              if(current.sysapproval.cat_item.getDisplayValue() == 'Item NAME') {


                                                                                              template.print('<p>' + gs.getMessage('Requested Role') }</p>');


                                                              }


                              }


                             



Please mark correct or helpful.



Regards,


Parvinder


Hi Parvinder, thanks we went down mail script route for this