Create a persistent banner annoucement to show time critical + auto-updating details for all users. What we want is a way to show a piece of text for all users on servicenow interface. It must be auto-updating in real time. The user can be at any page on servicenow and they must be able to see this info.
What we are suggesting that we create a Banner Annoucements [ docs link ]. It is a nifty tool to communicate with users. The announcement could be dismissable or not. Banner announcement can have multiple classes ( from info to critical alert) allowing for a nuanced approach.
We are going to use this, additionally we shall write a Scheduled Job
to update the banner in real time. We are using an interval of 1 second
since we are putting current time in the annoucenement text. But you could/should use appropriate time interval as per need.
Create a new Banner Annoucement [ table : sys_ux_banner_announcement
]
I’ve marked the announcement as Non-dismissable, you should decide your use case. Once saved, copy the sys_id of this record, we will need it for next step.
Create a new Scheduled Job [ table : sysauto_script
]
var announcement = new GlideRecord("sys_ux_banner_announcement");
announcement.get("<sys_id from step 1>");
var epoch = new GlideDateTime();
announcement.heading = "loop91 - Tinkering with ServiceNow - " + epoch.getDisplayValue();
announcement.update();
Use the sys_id saved in step 1 on line 2 in given code.
I’ve set the scheduled job to run every 1 second to update clock on the announcement every second. You should use appropriate time interval here to optimise the execution.
That’s it. You have a continuously running clock on the banner announcement.
Some extra nuggets of info: