SOW landing page issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 03:25 PM
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?
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:48 PM
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);
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 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 03:02 PM
@Bradley Marin any idea on this?
Johnny
Please mark this response as correct or helpful if it assisted you with your question.