How to redirect home page based on csm agents role sn_customerservice_agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hello All,
How to achieve the below requirement in servicenow:
How to redirect csm workspace view home page based on csm agent - role sn_customerservice_agent
and we tried updated on below script on script include "SPEntryPage" but it's not works on impersonate to the user role of ' 'sn_customerservice_agent' redirect to csm workspace view. Please suggest on this:
if (user.hasRole('sn_customerservice_agent') && !user.hasRole('admin') && !redirectURL && !isServicePortalURL)
return "now/cwf/agent/home";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
thanks for sharing the screenshots
the link I shared earlier will work for you
Homepage Redirect Rules in Next Experience
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago - last edited 4 hours ago
Hi @ashok17
Initially can you just add mentioned snippet and if it works then update your code.
- Navigate to System Definition > Script Includes and search for SPEntryPage.
- Locate the getFirstPageURL function.
- Insert the following condition
if (gs.hasRole('sn_customerservice_agent'))
{
return "/now/cwf/agent/home";
}
Refer: KB0746730 How to configure user redirects in Service Portal
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Tanushree Maiti ,
I have already updated script in the script include but not works , means when ever to impersonate login the below role it's not redirecting the csm workspace view
Referred to by property: glide.entry.first.page.script
*
**/
getFirstPageURL: function() {
var session = gs.getSession();
this.logProperties('before', session);
// has roles and is not a Service Portal page - go to UI16
var nt = session.getProperty("nav_to");
var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt);
var redirectURL = session.getProperty("login_redirect");
if (user.hasRole('itil') && !redirectURL && !isServicePortalURL)
return;
if ((user.hasRole('RI+') || user.hasRole('provider')) && !redirectURL && !isServicePortalURL)
return "/now/sow/list";
if (user.hasRole('sn_customerservice_agent') && !user.hasRole('admin') && !redirectURL && !isServicePortalURL)
return "now/cwf/agent/home";