Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to setup default home page for itil users?

Shiva prasad t
Tera Guru

I want to setup default home page as agent workspace for ITIL users. How could I achieve that!!

 

2 REPLIES 2

Paul Curwen
Giga Sage

Add the following lines of code to the getFirstPageURL function of the SPEntryPage script include:


if(gs.hasRole('itil')){  // note you will need to identify and change what role you want to redirect to agent workspace
return '/now/workspace/agent/home';
}

If you are on Next Experience follow this article: 

 

https://docs.servicenow.com/en-US/bundle/tokyo-it-service-management/page/product/service-operations...

 

 

 

If this helps please mark as Helpful/Correct

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Hello @Paul Curwen 

 

I wrote this below script in the SPEntryPage script include: 

 

var gScript = new globalServerUtils();
if(gScript.hasRoleExactly('itil') && session.getClientData('newLogin') != 'false'){
session.putClientData('newLogin', 'false');
gs.info('Running SPEntry Page'+session.getClientData('myData'));
return "/now/workspace/agent/home";
}
if (user.hasRoles() && !redirectURL && !isServicePortalURL)
return;

 

But what happened is, there is one sys property which we created to turn on/off the next experience on user preference.

I think, Because of that whenever the itil user loggedin to the servicenow it's not redirecting to agent workspace. Instead of that it's redirecting to "/now/nav/ui/home" .

So how could i add script to work it as expected.