Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

SC_Request approve notification - can I get access to which catalog item triggered the notification

geromeF
Tera Contributor

Hello Everyone,

 

I am struggling with creating a script only run the approve notification to a specific catalog item. Any help will be appreciated. 

1 REPLY 1

kirankawle
Tera Contributor

To create a script that triggers an approval notification for a specific catalog item in ServiceNow, you can use a Business Rule or an Event. Here's a step-by-step guide:

Create a Business Rule:

Navigate to System Definition > Business Rules.

Click New to create a new Business Rule.

Set the Table to sc_req_item (Requested Item).

Define the Condition to check for your specific catalog item. For example:
current.cat_item.name=='yourcatalog item name'
gs.eventQueue('custom.approval.notification', current, current.requested_for, current.opened_by);
Create an Event:

Navigate to System Policy > Events > Registry.

Register a new event, e.g., custom.approval.notification.

Add a description for clarity.

Create a Notification:

Navigate to System Notification > Email > Notifications.

Create a new notification and set the When to Send condition to the event you created (custom.approval.notification).

Customize the email template to include details about the catalog item.