How to change the Additional Comment journal field Label with red color

shashanksha
Tera Contributor

How to highlight the Additional Comment journal field Label with red color incident form.

1 ACCEPTED SOLUTION

@shashanksha 

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

View solution in original post

13 REPLIES 13

  • The additional comment's text Font and text Color are changed in tokyo upgrade when compared with Sandiego.
  • Font color for Polaris theme is changed at base level 'css_includes_ng_polaris.cssx' in Tokyo version. This looks to be an intentional change to avoid passing a static color and instead apply color based on the color variables.

 

Refer this KB: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1296262

 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand

Ankur Bawiskar
Tera Patron
Tera Patron

@shashanksha 

is it a business requirement to change the label for that field?

try this and ensure the Isolate Script field is False

function onLoad() {
    // Get the label element for the Additional Comments field
    var label = document.querySelector('label[for="incident.comments"]'); // Adjust the selector based on your field's name
    if (label) {
        label.style.color = 'red';
    }
}

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

@shashanksha 

this worked for me with DOM manipulation

Ensure Isolate Script field is False so that DOM works

setTimeout(function(){
$j("span:contains(" + 'Additional comments'+ ")").each(function () {
            $j(this).css('color', 'red');    //mark the content
        });

}, 5000);

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 ,

The code is changing the color for all activity field. Shown below. I only want for additional comment

shashanksha_0-1734445001508.png

 

@shashanksha 

this worked for me and it added color only for Additional comments

setTimeout(function(){
$j("label:has(span:contains('Additional comments (Customer visible)'))").each(function() {
    // Code to execute for each label containing a span with specific text
    $j(this).css('color', 'red'); // Example: change label color
});
}, 5000);

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