Different behavior of email URL redirection for user with manager role and agent role in CSM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2022 09:20 PM - edited 11-09-2022 09:22 PM
Hi All,
I've created an email notification body and made a Number( hyperlink) to redirect the user to the portal/Native UI based on the roles provided in CSM.
Manager - it should redirect to Native UI to get case number details.
Agent - it should redirect to the portal to get case detail.
The above function is working fine in the Dev instance but the same functionality is not working in the Test instance/Prod instance once the code is moved successfully. we are trying to debug the different behavior from Dev to the Test instance but have had no luck even though the code is the same in both instances.
Mail script :
if (current.account != '' && current.account.u_support_group != '') {
var idpsg = gs.getProperty('p_parent_group'); //Sys Id of P group
var flag = 1;
var current_group = current.account.u_support_group.sys_id; //current accounts support group
var parent = "";
while (flag == 1 && current_group != '' && current_group != 'undefined') {
//Loop until parent is empty in the group record
var gr = new GlideRecord('sys_user_group');
gr.addQuery('sys_id', current_group);
gr.query();
if (gr.next()) {
if (gr.parent != "") {
//set current parent to current_group for next iteration
current_group = gr.parent.sys_id;
} else {
//Top level parent found. Return Parent ID and terminate loop .
parent = gr.sys_id;
flag = 0;
}
}
}
var html = '';
if (parent == idpsg) {
html = '<a href="' + gs.getProperty('glide.servlet.uri') + 'p?id=csm_ticket_p&isNotification=true&table=x_p_case&view=default&sys_id=' + current.sys_id + '">' + current.number + '</a>';
}
//Print the Link
template.print(html);
}
Any help on this is really appreciated.
Thanks,
Abhishek