- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 04:54 AM
Hi
I searched the forum and wiki but with no luck. Is there any tricky way to display the task number in browser window title, i.e. replacing ... with
? Refer to the attached screenshot.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2009 05:17 AM
I've used this script before. It sets both the number and short description if they are there. You'll need to use this code in a new UI script record under 'System UI -> UI scripts'.
addLoadEvent(setTitle);
function setTitle(){
try{
var num = g_form.getValue("number");
var sd = g_form.getValue("short_description");
}catch(e){
//alert('Error getting title info.');
}
if(num && sd){
top.document.title = num + ' - ' + sd;
}
else{
top.document.title='Service-now.com - IT Service Management Suite';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2009 01:03 PM
Hi Mark.
Sorry. I wrongly created this script as onLoad script over the task table while I should have followed your instructions and created it in UI Scripts.
It works fine after I created it in the right place!
Sorry again.
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2009 07:49 PM
Hey Mark,
I like this script and was trying to get it running in my dev instance to try it out.
The UI Script doesn't appear to be firing though. I checked that it's active etc, but putting alert() debugging in showed that the function wasn't even firing.
Any advice on why this isn't working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2009 07:51 PM
You probably don't have the 'Global' checkbox checked in the UI script. Without that, the function has to be called from another script. Check the 'Global' checkbox and it should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2016 10:26 AM
Hey Mark!!
I have a table displaying null on the window and used this script and it works perfectly! But the problem is, I need to reload the page after opening it, for it to capture the number and display. When I open it the first time, it still shows null. Is there something I'm doing wrong? Or is there a workaround? This is the script I'm using.
addLoadEvent(setTitle);
function setTitle(){
try{
var num = g_form.getValue('number');
var nme = g_form.getValue('name');
//Check if viewing a KB article
if($('kb_view')){
num = $('permalink').href.split('sysparm_article=')[1];
sd = $$('.kb_article_header_short_description')[0].innerHTML;
}
if(num){
top.document.title = num + ' | ServiceNow';
}
else if(nme){
top.document.title = nme + ' | ServiceNow';
}
else{
top.document.title='ServiceNow ITSM Suite';
}
}catch(e){
//alert('Error getting title info.');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2009 08:06 PM
Ah genius. The Global checkbox isn't visible on the UI Scripts form by default
Works like a charm now. I like it, and checking with the Service Desk guys they seem to like it too.