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

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.

Hello @Sujatha,

 

Many thanks for your solution. 🙂

 

I have implemented the changes in PDI as you have suggested. This is working correctly with some modification as my requirement.

 

But what my real issue is, I could not find any OOTB solution. The script include you have mentioned also is 'High Priority file', ServiceNow itself suggest us not to modify these files because this may effect next upgrade/patch update where this file may skip.

 

Could you please suggest me on this ?

 

Thanks & Regards,

Atanu Maity

 

It’s advised not to alter the OOB configurations.

 

Customisations are based on the requirement provided by the customers. If really don’t want to edit such files then you may convince the customer to ahead with OOB. 

Kindly refer the below links for more information: 

 

https://www.servicenow.com/docs/bundle/washingtondc-platform-administration/page/administer/upgrade-...

 

IMG_1358.jpeg

As per the above note in ServiceNow docs, please check the last few lines. 

https://www.servicenow.com/community/now-platform-articles/washingtondc-new-feature-managing-upgrade...

 

 

 

 

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

Hello @Sujatha,

 

Many thanks for your support and more information about OOTB changes.🙂

 

Kind Regards,

Atanu Maity