- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2022 11:42 PM
I want to send notification to user but user is in a string field how to get email of that user
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:19 AM
Ok, Got it..
Follow the steps below... It works...tested..
Step 1: Create a event registry record like below.
1.) In navigator, type this "sysevent_register.LIST" and click on new and fill the below details.
Step 2 : Create after insert/update business rule
In advance write the below script
(function executeRule(current, previous /*null when async*/ ) {
getUsername = current.write_serviceowner_fieldname;
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name', getUsername);
gr.query();
if (gr.next()) {
gs.eventQueue('notify.event', gr, gr.email);
}
})(current, previous);
Step 3: Create notification like below.
I hope it helps, if so please mark my response as helpful and correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:03 AM
Hi,
Didn't get your requirement..
Give me some more info...
On which table the string field is there? and when you want to trigger the notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:04 AM
it is on kb article and when service owner changes i want to send notification to that owner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 12:19 AM
Ok, Got it..
Follow the steps below... It works...tested..
Step 1: Create a event registry record like below.
1.) In navigator, type this "sysevent_register.LIST" and click on new and fill the below details.
Step 2 : Create after insert/update business rule
In advance write the below script
(function executeRule(current, previous /*null when async*/ ) {
getUsername = current.write_serviceowner_fieldname;
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name', getUsername);
gr.query();
if (gr.next()) {
gs.eventQueue('notify.event', gr, gr.email);
}
})(current, previous);
Step 3: Create notification like below.
I hope it helps, if so please mark my response as helpful and correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 02:43 AM
how to send email to old as well as new service owner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 03:02 AM
add one more line... and give a try..
var oldServiceOwner = previous.write_serviceowner_fieldname