- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2023 11:32 PM
Hello Everyone,
I am trying to trigger notification based on event. My use case is whenever i give multiple comments back to back in HR case all those comments should trigger notification.
Steps taken.
1. Created event.
2. Calling through BR
3. Updated event in Notification.
I can see that notification is being triggered but comment value is null.
Event:
BR:
Notification:
Emails activity
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 05:45 AM
Hello @Vijay Baokar ,
In your business rule use this in -
gs.eventQueue('event_name',current,current.comments.getJournalEntry(1));
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 06:20 AM
there was no need of business rule, event
You can directly use notification and condition for this
Any reason you went with the eventQueue approach?
There is already 1 OOB notification for Comments added by Opened By user, check this on HR Case table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 06:30 AM
Hello @Ankur Bawiskar
We have an issue when user gives back to back comments then sometime latest comments is getting fired and sometime duplicate emails with same comments are getting fired because when the notification engine tries to process the same record in literally no time (like 2-3 seconds gap) we are adding a new comment so the current object will be passed with the latest comments (Test 3) so the notification condition is matching 3 times and the current object has "Test 3" as comments in all of the emails. So if you have such scenarios, we can better use event-based notifications which use parm1 or parm2 fields containing the value rather than using notification engine-based notifications with "$comments" which indeed returns the latest value of the current object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 06:33 AM
Is this happening when you tested with the OOB notification which I shared above?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 09:54 AM
Yes, even HI team has reproduced this behavior.