- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 04:18 AM
Hi All,
My requirement is as follows :
When the Incident state is 'Closed' and 'Active' is false, any user updating the additional comments should receive the Email Notification stating 'Incident is already Closed'.
( Updating Additional Comments after Incident is Closed : In the Native view, it is only possible for admin users. But the additional comments get updated when any user replies to the Email sent regarding same Incident )
I had added fields like 'Caller', 'Updated by' in the 'Users/Groups in Fields' field in 'Who will Recieve' field. The Email notification is triggering. But only to selected fields in the 'Users/Groups in Fields' field.
For Example,
The email notification triggers to the 'Caller' field. But not to the 'Updated by' field. For the fulfilment of the request, it need to be triggered to 'Updated by' field. But it is not triggering. Why it is not triggering to certain fields and not to some other fields ?
Do we need to do any other modifications on this ?
Is there any other alternate ways to Implement this requirement.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 08:09 AM
In your image you put X on assigned_to and updated_by.
The reasons why they are not getting emails are very different.
Assigned_to is a reference field and should work as good as the Caller field. Troubleshooting notifications can be very tricky. I suggest you to press "preview notification" and hover on top of the crossed out names to understand why the assigned_to is not receiving the email.
Update_by is not a reference field (string field with the username) so it won't work. A solution for this could be to create an "email script" with the sole purpose to add the updated_by.email to the notification. You would do this by gliding the sys_user table and looking for the update_by glide record. Then you use the command: email.addAddress("cc", update_by_email);
Check this community article.
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 04:15 AM
Hi @Sebas Di Loreto ,
Sorry for the delayed response. I have created a mail script for the following as you suggested and called it in the body part of the email. But it is not working as expected. Could you please help me clarifying the error.
This was the script I created for the same :
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var userid = current.sys_updated_by; // Gets the User ID. 'Updated by' field is giving user-id of updated user.
var br = new GlideRecord("sys_user");
br.addQuery("user_name",userid); // Matched the user-id in the user table
br.query();
while(br.next()){
email.addAddress("cc",br.getValue('email')); //Added the updated by user's email id to cc.
}
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 05:13 AM
Double check the proper format for the email.addAddress command. I think you need to add the display name as the third parameter.
If I helped you with your case, please click the Thumb Icon and mark as Correct.