Adding the owner of the catalog item for the notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 10:57 PM
Hi All,
I have a requirement where for the catalog item "ServiceNow catalog Request" . Where under the "ServiceNow catalog Request" we have the variable which states "Request type" and the options are "New catalog item" , "Update existing catalog item" and "Remove existing catalog item " as shown below.
On selecting one of the option we have an another variable to choose a specific catalog item that is to be updated.
We have a specific notification that is set up to receive the work notes update and as of now it is been configured that "Requested for" should receive , How do add the Owner of the catalog that is selected "AC_test_template" in the "who should receive" section?
Note( we have an option to add the ServiceNow catalog Request catalog item's owner but not the AC_test_template's owner) as shown below
The notification should be sent to AC_test_template's owner but not the ServiceNow catalog Request's owner
How to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 02:35 AM
Hello @phr ,
You can trigger the notification to the selected catalog item owner by creating a on change client script and script include to get the selected catalog item owner and set it to a variable on the catalog form and hide it(if you want). Then configure the notification - Item.<variable_name>
//Script Include Function:
getOwner: function(catalogItemSysId) {
var owner = '';
var gr = new GlideRecord('sc_cat_item'); // Table for catalog items
if (gr.get(catalogItemSysId)) {
owner = gr.u_owner.toString(); // Assuming 'u_owner' is the field for the owner
}
return owner;
},
Please Mark My Answer as Helpful and Accept as Solution, if you find this article helpful or resolves your issue.