- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 01:34 PM
Hello SN Community!
When a sn_customerservice_case is closed and a client responds to an email, they should receive a notification back to them that their case has already been closed.
I have an inbound action setup:
With the following code under 'action':
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
gs.include('validators');
if (current.getTableName() == 'sn_customerservice_case') {
if (current.active == 'false') {
gs.eventQueue('sn_customerservice.case_closed_email', record, '', gs.getUserName());
}
}
})(current, event, email, logger, classifier);
When I run a test, however, I get an an error:
And it doesn't trigger the event (which would then trigger the notification that tells the client the case was already resolved).
Any ideas?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 04:05 PM
Hi Julia,
Is Action type = Record Action? Perhaps this is the cause, in spite of your script not changing the record and only triggering an event. Action Type = Reply Email would send a mail, but the email would be defined in the inbound action, rather than triggering a notification, and I don't think you can use a script.
You could try Flow Designer instead. Select Inbound Email as the trigger and use the Create Record action to create a log entry in the sysevent table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 01:45 PM
Hi there!
Can you add screenshots again as it is broken.
Regards,
Palak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 01:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2022 08:32 AM
Hi Julia Howells,
1. In "When to run" section update "Action Type" to "Reply Email" instead of "Record Action".
2. In "Action" section update below code.
(function runAction( /*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
gs.include('validators');
if (current.getTableName() == 'sn_customerservice_case') {
if (current.active == 'false' && current.state =='resolved')//backend value of resolved
{
gs.eventQueue('sn_customerservice.case_closed_email', current,gs.getUser().getEmail());
}
}
})(current, event, email, logger, classifier);
Try below changes and let me know if that works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 01:49 PM
Ah! Thanks! Just sent the screenshots