SOW landing page issue

JohnnySnow
Kilo Sage

Hi Team,

 

I'm trying to set the landing page for the OOTB Service desk group, so when a user from the servicedesk group logs in , they would see the SOW landing page instead of the home pages. To do that I'm referring below sections of the sn docs and it doesnt seem to work. 

 

Can some one specify how to do it?

JohnnySnow_0-1701732190342.png

 

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.
2 REPLIES 2

AnveshKumar M
Tera Sage
Tera Sage

Hi @JohnnySnow 

 

Create an After - Insert Business Rule on the sys_user_grmember table.

 

Conditions:

 

Group :: IS :: Service Desk

 

And use the script below.

 

(function executeRule(current, previous /*null when async*/ ) {

        var gr = new GlideRecord('sys_user_preference');

        gr.addQuery('name', 'my_home_navigation_page');

        gr.addQuery('user', current.user.toString());

        gr.query();

        if (gr.next()) {

            gr.value = '/now/sow/home';

            gr.update();

        } else {

            gr.initialize();

            gr.value = '/now/sow/home';

            gr.name = 'my_home_navigation_page';

            gr.user = current.user.toString();

            gr.insert();

        }

})(current, previous);

 

Screenshot_2023-12-05-08-12-15-624-edit_com.android.chrome.jpg

 

So this BR will assign SOW as home page if any user is added to Service Desk group. For existing users who are already members of the group, run the following script either in background Script or Fix Scripts.

 

var gGr = new GlideRecord("sys_user_grmember");

gGr.addQuery("group", "d625dccec0a8016700a222a0f7900d06"); //sys ID of Service Desk group

gGr.query();

while(gGr._next()){

var gr = new GlideRecord('sys_user_preference');

 

        gr.addQuery('name', 'my_home_navigation_page');

        gr.addQuery('user', gGr.user.toString());

        gr.query();

        if (gr.next()) {

            gr.value = '/now/sow/home';

            gr.update();

        } else {

            gr.initialize();

            gr.value = '/now/sow/home';

            gr.name = 'my_home_navigation_page';

            gr.user = gGr.user.toString();

            gr.insert();

        }

}

 

 

Please mark my answer helpful and accept as solution if it helped 👍

Thanks,
Anvesh

JohnnySnow
Kilo Sage

 

@Bradley Marin any idea on this?

 

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.