Highlighting @mentions in the Work notes

akash42
Tera Contributor

Currently, when we use the @mention feature in Work Notes on any type of ticket (e.g., @johnsmithh), it only inserts the "@" symbol followed by the user’s name. However, there is no highlighting or visual styling applied, which makes mentions easy to miss in long comment threads.

Is there a way to highlight @mention (for example, by adding color or styling) to make them more noticeable?

6 REPLIES 6

@akash42 

I was able to test it with this script and highlight it in blue color

  $j('.sn-widget-textblock-body.sn-widget-textblock-body_formatted.ng-binding.ng-scope').each(function() {
    var text = $j(this).text();
    if (text.indexOf('@') !== -1) {
      // Add yellow color to the text
      $j(this).css('color', 'blue');
    }
  });

AnkurBawiskar_0-1757570164686.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

Srikanth_9
Tera Contributor

Hi @akash42 

 

By default, ServiceNow’s activity stream / journal fields (work notes, additional comments, etc.) only render @mentions as plain text — meaning you’ll see @John Smith, but there’s no highlight or clickable link unless you add some customization.

 

You can add a UI Script or onLoad Client Script that finds @mentions in the activity stream and wraps them in a <span> with styling using CSS.

If the provided solution is working, please Accept as Solution and hit the Helpful. 
 
Thanks & Regards,
Akula Srikanth.