diff --git a/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Readme.md b/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Readme.md new file mode 100644 index 0000000000..3661b5d0e2 --- /dev/null +++ b/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Readme.md @@ -0,0 +1,3 @@ +Advance condition section in notification, enables with the capability to filter any kind of data present in the system and based on that you can trigger the notification. In my scenario, I have done it for the specific catalog item, whenever you request any catalog item, this notification would only trogger when the sys_id matches with the particular catalog item's sys_Id. + +Note: Advance condition section always returns the Boolean value as same as we have in entitlement scripts and if condition passes it returns true or else it returns false. diff --git a/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Trigger notification for particular catalog item.js b/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Trigger notification for particular catalog item.js new file mode 100644 index 0000000000..41c3f90439 --- /dev/null +++ b/Specialized Areas/Advanced Conditions/Check Catalog item for notification/Trigger notification for particular catalog item.js @@ -0,0 +1,12 @@ +var item = new GlideRecord("sc_req_item"); +item.addQuery("request",current.sys_id); //filter the request from the RITM table. +item.query(); +if(item.next()){ + var ID = item.cat_item.toString(); + var itemId = "sys_id of the catalog item"; + if(itemId == ID){ + answer = true; + }else{ + answer = false; + } +}