Script to trigger a email notification based on event registry

Nandhinisri
Tera Contributor

Hi ,

 

I am not much exposed to scripting and need help to execute the following logic.  An email notification has to be sent to the recipient at the end of each week for three weeks if the state is fix in progress and action status is pending. The outline of the execution is Notification ---> Event registry ---> Scheduled Jobs . The script to be executed in Jobs and event registry should be called in script.

 

 

TIA

 

 

1 ACCEPTED SOLUTION

Anand Kumar P
Giga Patron

Hi @Nandhinisri 

 

1. Event Registry: Create an event (fix_in_progress.weekly_notification) under Event Registry, linked to the relevant table.

2. Encoded Query: Define the conditions for records (state=Fix in Progress^action_status=Pending) by filtering the list view and copying the encoded query paste in schedule job script qury.

3. Scheduled Job: Create a scheduled job to run weekly, query records matching the conditions, and fire the event for each record.

4. Notification: Set up a notification triggered by the event, specifying recipients and email content.

5. Email Execution: The notification sends emails based on the event and runs until the job no longer finds matching records.

https://www.servicenow.com/community/guided-learning-itsm/need-to-send-an-email-notification-on-last...

 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand

View solution in original post

3 REPLIES 3

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Nandhinisri 

Please refer below youtube video:

https://www.youtube.com/live/jXkGt4iJsnY?si=mCU7xFpXc91M212P

 

Please find the below doc:

https://developer.servicenow.com/dev.do#!/learn/learning-plans/xanadu/new_to_servicenow/app_store_le...

 

Since you mentioned you aren't exposed to scripting, This is much easier to do with Flow Designer...

Please refer Robert"s video

https://youtu.be/FtOT4aDs7lo?si=oEolxkJXeXIZnFLj

 

Please mark the answer as helpful and correct if helped. 

Kind Regards,

Ravi Chandra  

 

 

Anand Kumar P
Giga Patron

Hi @Nandhinisri 

 

1. Event Registry: Create an event (fix_in_progress.weekly_notification) under Event Registry, linked to the relevant table.

2. Encoded Query: Define the conditions for records (state=Fix in Progress^action_status=Pending) by filtering the list view and copying the encoded query paste in schedule job script qury.

3. Scheduled Job: Create a scheduled job to run weekly, query records matching the conditions, and fire the event for each record.

4. Notification: Set up a notification triggered by the event, specifying recipients and email content.

5. Email Execution: The notification sends emails based on the event and runs until the job no longer finds matching records.

https://www.servicenow.com/community/guided-learning-itsm/need-to-send-an-email-notification-on-last...

 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand

Can I have the script for the logic for problem table?