Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

If @mention is used in an Interaction, the standard @mention notification is not tokens

tworzala
Tera Contributor

When we use the @mention in an interaction record, the notification is completely blank. It has verbiage and the link to the record if we use @MENTION in HR case records, incidents, etc. Help!

5 REPLIES 5

Me Being Mustaq
Tera Guru

Hi @tworzala ,

 

When @mention notifications from interaction records appear completely blank, unlike HR cases or incidents that show verbiage and record link, the root cause is typically the notification email script not correctly fetching display data for the interaction record.

Key aspects to address:

  • The standard notification script (like ng_activity_mention_body) works well for tables like Incident or HR Case because it retrieves known display fields (e.g., incident number) to include in the email content.

  • Interaction records have a different structure, and the script may not find appropriate display values, causing the email body to be empty except for the link.

  • Customize the notification email script or create a specialized email notification for interaction records. Adjust the script to query the interaction record by sys_id, then fetch a meaningful field such as subject or short_description to include in the notification.

  • Confirm that the notification user preferences, email templates, and Connect plugins are all properly configured to support mentions on interaction records.

 

Please refer to the below link:-

 

If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

 

Thanks & Regards,

Mohammed Mustaq Shaik

I tried creating a new notification for interaction records but nothing is working when I actually test it out. Do you have a simple script you could share with me that works? We have OOTB config for interactions.

Hi @tworzala ,

 

Check the "ng_activity_mention_body" Mail Script
Ensure your mail script handles the interaction table explicitly. Add logic to display the record information for the interaction table, similar to what's done for incidence/HR case:

var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
    email.setSubject("You have been mentioned in " + recordGR.getDisplayValue());
    email.body = "You were mentioned by " + gs.getUserDisplayName() + " in Interaction record <a href='"+gs.getProperty('glide.servlet.uri')+"interaction.do?sys_id="+recordGR.getUniqueValue()+"'>"+recordGR.getDisplayValue()+"</a>";
}

Make sure the script checks for and populates data for interactions.

 

Please refer to the below link:-

If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

Thanks & Regards,

Mohammed Mustaq Shaik

 

 

I used the mail script above that you put in. In the notification in the What will it contain tab, I just have the mail script token in there. When I test it out the notification is blank.