Event based notification no passing comment

Vijay Baokar
Kilo Sage

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:

VijayBaokar_0-1698042444792.png

 BR:

VijayBaokar_1-1698042518663.png

 

Notification:

VijayBaokar_2-1698042584113.pngVijayBaokar_3-1698042632302.png

 

Emails activity

VijayBaokar_4-1698042687929.png

 

 

1 ACCEPTED SOLUTION

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.

 

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Baokar 

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

 

AnkurBawiskar_0-1698067211975.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.

@Vijay Baokar 

Is this happening when you tested with the OOB notification which I shared above?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes, even HI team has reproduced this behavior.