Browser Window Title - display task number (e.g. INC0000046)

nikita_mironov
Kilo Guru

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.

1 ACCEPTED SOLUTION

Mark Stanger
Giga Sage

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';
}
}


View solution in original post

10 REPLIES 10

Mark Stanger
Giga Sage

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';
}
}


Many thanks Mark. This is exactly what we need


Hmm.. It works perfectly but the window title stays "INC000 -bla-bla" when I return to the LIST of incidents. That;s not really good and I have no idea how to overcome this since we have frames here. Is there any way to reset it back to "IT Service Management..." when user gets back to the list or homepage?


I'm using this exact script on my instance and I'm not seeing this issue. The script is specifically designed to avoid this problem. If you PM me the instance name where you've got this set up I can take a look. You could also test this on the Service-now demo site. I've got it set up there and it's working just fine there.