Notification colour button

Glen B_
Tera Expert

Hi everyone,

 

Hope this really does not seem a stupid question

I am working in a migration to the new notifications, however no where in the related scripts or html is there a clear idea on where to change the "View Request" colour, any pointers here would be greatly appreciated.

 

Thanks,

1 ACCEPTED SOLUTION

@Glen B_ Found the root where the color settings are available. It is part of RequestNotificationUtilSNC script include's createNotificationPrimayAction method

 

Screenshot 2024-09-13 at 5.06.13 PM.png

Since this is a write protected script include from ServiceNow, you can't make changes to it. However, it has an extended version in form of RequestNotificationUtil which you can edit and control the appearance of the button through it.

 

Screenshot 2024-09-13 at 5.06.33 PM.png

Just copy the implementation of createNotificationPrimayAction method from RequestNotificationUtilSNC script include, paste it inside the extended version RequestNotificationUtil and apply changes related to font and color.

 

Please mark my response helpful and accepted solution if it addresses your question.

View solution in original post

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@Glen B_ This button should be a part of an email script. You can use the Show Email scripts UI Action to find the email scripts associated with the notification and in those emails scripts you can try and find the email script responsible for rendering button. You will find the CSS setting the color for this button in the same script.

Screenshot 2024-09-13 at 2.59.42 PM.png

Hope this helps.

Hi Sandeep,

That was my initial though, however while it part of the script, it has no color hex coding associated with it, the script is "about_this_request"

and can see

var buttonText = gs.getMessage('View request');
    var requestNotificationJs = new global.RequestNotificationUtil();
    requestNotificationJs.createNotificationPrimayAction(template, requestUrl, buttonText);

in previous I have see this has been specified before, and even used this in notifications previously.

@Glen B_ Found the root where the color settings are available. It is part of RequestNotificationUtilSNC script include's createNotificationPrimayAction method

 

Screenshot 2024-09-13 at 5.06.13 PM.png

Since this is a write protected script include from ServiceNow, you can't make changes to it. However, it has an extended version in form of RequestNotificationUtil which you can edit and control the appearance of the button through it.

 

Screenshot 2024-09-13 at 5.06.33 PM.png

Just copy the implementation of createNotificationPrimayAction method from RequestNotificationUtilSNC script include, paste it inside the extended version RequestNotificationUtil and apply changes related to font and color.

 

Please mark my response helpful and accepted solution if it addresses your question.

Thanks Sandeep, that has worked perfect, and can see it's a similar process for the other alerts