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.

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?

8 REPLIES 8

@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

@akash42 

Hope you are doing good.

Did my reply answer your question?

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.

CharanV98428402
Tera Contributor

Hi @akash42,
Yes, it’s possible to make @mentions more noticeable, but it requires some customization. You can use an onLoad client script or a UI script to detect when an @mention is added in the Work Notes field, and then apply DOM manipulation to add styling (such as color, bold text, or highlighting).

That said, please note that direct DOM manipulation is not a recommended best practice in ServiceNow, as it can lead to upgrade or maintenance issues. If you decide to proceed, be sure to clearly inform your customer of the risks.

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

Regards,
Charan V