- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2009 06:52 AM
Has anybody done anything with showing the ticket number in the title bar in the browser window?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2009 07:29 AM
I think this will work for you. You can set up a UI Script under the 'System UI' application with the script below. The UI Script will have to have the 'Global' checkbox checked. This script sets the number and short description in the title if those elements are found on the form. If they aren't found, then a standard title is used.
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
‎07-08-2009 07:29 AM
I think this will work for you. You can set up a UI Script under the 'System UI' application with the script below. The UI Script will have to have the 'Global' checkbox checked. This script sets the number and short description in the title if those elements are found on the form. If they aren't found, then a standard title is used.
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
‎05-10-2016 05:19 AM
This doesn't work in "Fuji" - editor throws an error for line 9 when trying to save the script ("...Missing ) for condition...").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2016 08:24 AM
The code example has changed the 'ampersand' character to HTML. You need to substitute where it says && with two ampersand characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2016 11:36 PM
Hi Peter,
Thanks for that hint, works perfect now - although I should have recognize this by myself
Best regards
Stefan