- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 01:41 AM
1. I have created new email client template that auto populate "Caller" Email in TO field.
2.But I want this functionality or display this template only when the users A having specific role e.g. "role1" .
3.for other users this should work as normally.(Default Template).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 03:42 AM
I don't feel you have direct way to do it. But as a workaround you can follow the below steps.
Step 1. Add dummy condition say Caller Id is javascript:new test().roleCheck(current)
Note: test is my script include and roleCheck is my method and passing the current record as an argument
Step 2: In your script include function roleCheck have the logic to check whether the user has the role or not. You can use the below code
roleCheck: function(current) {
if(gs.hasRole("admin")){ //Please update the role here, I've considered admin role
return current.caller_id;
}
return false;
}
Step 3: Test the behavior.
Note: This will just apply the template when the user click on the "Email" from incident record.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 03:42 AM
I don't feel you have direct way to do it. But as a workaround you can follow the below steps.
Step 1. Add dummy condition say Caller Id is javascript:new test().roleCheck(current)
Note: test is my script include and roleCheck is my method and passing the current record as an argument
Step 2: In your script include function roleCheck have the logic to check whether the user has the role or not. You can use the below code
roleCheck: function(current) {
if(gs.hasRole("admin")){ //Please update the role here, I've considered admin role
return current.caller_id;
}
return false;
}
Step 3: Test the behavior.
Note: This will just apply the template when the user click on the "Email" from incident record.
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 06:43 AM
Thank you.....Works for me
I used gs.hasRoleExactly('itil') insted of gs.hasRole();