Send notification to the knowledge admin user
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 08:19 AM
Need to add recipient as a knowledge admin in the notification.
I have tried both the script in advanced condition of notifications-
answer = false;
if (gs.hasRole("knowledge_admin")) {
answer = true;
}
AND
function userHasRole() {
var userGr = new GlideRecord("sys_user_has_role");
userGr.addQuery('user', current.session_user); //field on the record who will be the recipient
userGr.addQuery('role.nameINknowledge_admin');
userGr.query();
if (userGr.next()) {
return true;
} else
return false;
}
But there is no notification for knowledge admin role is triggered.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:37 AM
Hi @Priti Deshmukh try this code
if (gs.hasRole('knowledge_admin')) {
answer = true;
} else {
answer = false;
}
Regards,
Sid
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:50 PM
hey @Priti Deshmukh
so just for understanding , you need to send notifications right so why not create a record in notifications table for knowledge table, add users role for knowledge_admin and also let me know what is the condition for triggering notification...
Please accept the solution /mark this response as correct or helpful if it assisted you with your question.
Regards,
Animesh