Workspace make home page/default page

A_maity002
Tera Contributor

Hello Everyone,

 

I have received a requirement where we need to make the SOW (Service Operations Workspace) to be the default homepage for all ITIL users/particular groups.

 

Please advice me how can I suggest this.

 

Kind Regards,

Atanu Maity

atanumaity730@gmail.com

1 ACCEPTED SOLUTION

Sujatha V M
Kilo Patron
Kilo Patron

 

@A_maity002  Please find the details below for routing it to Service Operations Workspace. 

 

1. Navigate to Script Include -> SPEntryPage

 

2. Edit the "getFirstPageURL" function as below, 

 

SujathaVM_1-1740405439698.png

 

 var roleCheck = new GlideRecord('sys_user_has_role');
        roleCheck.addQuery('user', gs.getUserID());
		roleCheck.addQuery('role','!=',gs.getProperty('internal.role')); 
        roleCheck.query();
        if (roleCheck.getRowCount() > 0)
            this.hasRoles = true;
		
		if(gs.hasRole('admin')) {
			return;
		}
        else if (gs.hasRole('itil')) {
            return '/now/sow/home';                         //Route to SOW if user has ITIL role
        } 
		else {
            if (!gs.hasRole('itil') && this.hasRoles) {
                return 'now/nav/ui/home';                  //Route to Homepage if user has no ITIL role but has other roles
            }
			else if(!this.hasRoles) {
				return '/sp';                            //Route to Portal if no roles
			}
        }

 

 

Note: Modify the script accordingly for the assignment group check along with the ITIL role.

 

Results : 

User(s) with ITIL role

SujathaVM_2-1740408160328.png

 

User(s) without ITIL role but other roles

SujathaVM_3-1740408427913.png

User(s) with no roles

SujathaVM_4-1740408827717.png

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

View solution in original post

5 REPLIES 5

Glad to know it had helped you! I hope you have learnt something new today 😊 Many more to cherish! 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.