How do live_notification records get inserted for @ mentions in work notes and additional comments?

chrisperry
Giga Sage

As everyone knows, @ mention notifications in work notes and additional comments fields trigger live_notification records to be inserted, which then trigger OOTB email notifications to the @ mentioned user to let them know that they've been mentioned.

 

However, I'm unable to find any documentation or anything in the platform (business rules, script includes, etc.) that shows the mechanism/logic that actually causes these live_notification records to be inserted when an @ mention occurs in the work notes or additional comments fields. Does anyone know what piece of code, etc. is responsible for inserting live_notification records when an @ mention occurs in work notes or additional comments?

 

Thanks,

Chris

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry
4 REPLIES 4

PaulSylo
Tera Sage
Tera Sage

Hi @chrisperry -

 

I don't know i can solve your issue but I would suggest checking this link given below, A Long time back, I came across one good discussion from @Allen Andreas. You may refer to this to get some good ideas.

 

I solved my query in this discussion, regarding a system property. but check out, maybe you get some pointers to your ask.

https://www.servicenow.com/community/itsm-forum/mention-notification-issue/m-p/248876/page/2

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0779851

 

Regards,
PaulSylo

Kindly mark "helpful", if this helps, or Mark as "Accepted " if it solves your issues !

Sumanth16
Kilo Patron

Hi @chrisperry ,

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0781565

https://www.servicenow.com/community/itsm-forum/mention-in-work-notes-is-not-working-for-some-tables...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

chrisperry
Giga Sage

Hi @PaulSylo & @Sumanth16 ,

 

Thank you for your responses. My issue in this case isn't with the notifications not firing for @ mentions triggering those live_notifications, it is actually because live_notification records are getting triggered for @ mentions in work notes when they shouldn't be.

 

Basically we have a custom app where there is a parent task record which spawns multiple child task records over the process flow's lifecycle. I built logic to cascade work notes back and forth between parent and child records, and that part is working great where it doesn't create an infinite loop of cascading work notes. So if a work note is originally added to parent record, that work note is then cascaded down to all child tasks, and if a work note is originally added to a child task, it cascades up to the parent record.

Now, the issue is when someone uses an @ mention in the work note to trigger a live_notification record to ad hoc notify the individual user (OOTB live_notification email notification, plus we added a push notification to tell the user they've been mentioned). Because of the work notes cascading, this was causing the @ mentioned user to receive a notification for the mention on the parent record, and to receive notifications for the cascaded mention on the child records as well. So... I updated the logic which cascades the work notes to look for the '@' symbol in the work note before cascading it to the other records, and if it exists, remove the @ symbol with the intention of avoiding the 'dupe' insert of a live_notification for the cascaded work note.

This works great when a work note w/ @ mention is added from desktop... however, if the work note w/ @ mention is added from mobile, apparently servicenow processes live_notification and work notes updates differently, and still inserts the live_notification record for the @ mention on the cascaded work notes, even though the @ symbol doesn't exist on the work note getting cascaded to those records.

 

So what I'm trying to figure out is how those live_notification records get inserted in the first place, to potentially suppress the insert of those records when I need to prevent the @ mention notification from being triggered via @ mention in work note in mobile.

 

Thanks,

Chris

If this answer is helpful please mark correct and helpful!

Regards,
Chris Perry

Li8
Tera Contributor

Hey there,

did you get an answer or work out how this works ? i seem to have the same issue where an @mention seems to not create a record in the live_notification table. 

i can see lots of documents referencing a requirement to add the journal input fields into the activity stream. I've tried this and no luck.

Also i can manually create a record in the live_notification table and it generates a notification correctly to the end user. So that part is working.

Also i double checked that we have UI16 is running. We are now on Yokohama and using the full polaris next experience.

Kind of running into a bit of a road block from here. 

Is there a internal script or business rule of some sort that's creating the live_notification record ?

 

Thanks in advance and ill keep searching myself.

Cheers

Lee