Send a notification on Inbound email action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 04:59 PM
I have created an Inbound action on incident table.
Where, its matching the condition on incident, if the incident is found, then do the updates from inbound. This works fine.
Now, I just want to sent an email notification if the incident is not found. I was just wondering the following solution will work or not:
1. I am thinking of registering a new event and then using that in my else condition of the same inbound action,
2. which will then fire the notification. Is that going to work without any errors?
Please suggest if this is the best or do we have any other best option as well.
Thanks in advance!
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 11:10 PM
The only problem with my code is, it is always executing the "gs.eventQueue("task.no.externalref.found", targetRec, email.body.external_reference, email.body_text);" even if I use the opposite of the IF and is not entering the else (highlighted in bold) at all.
-------------------------------------------------------------------------------------------------------
if (targetRec.next()) {
if (targetRec.abc_reference_number != "" || targetRec.abc_reference_number != "email.body.external_reference")//This is working even if the reference number is empty
{
gs.eventQueue("task.no.externalref.found", targetRec, email.body.external_reference, email.body_text);
}
else {
targetRec.abc_reference_number = email.body.external_reference;
var worknote = email.body.worknotes;
targetRec.work_notes = worknote.replace(/<cr>/g, "\n");
//targetRec.work_notes = String(email.body.worknotes);
if(status == "Resolved" || status == "Closed")
{
targetRec.state = 6;
targetRec.u_cause_code="Unknown";
targetRec.u_resolution_code="Resolved By Third Party";
targetRec.u_actual_affected_ci= targetRec.u_technical_service;
}
else {
targetRec.state =status;
}
targetRec.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 11:14 PM
Is the column name correct abc_reference_number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 11:18 PM
Yes, I have changed the name here coz of security concerns.
Rest below part is working only, may be some braces issue or I have tried not using it as a string. Still no luck...
if (targetRec.abc_reference_number != '' || targetRec.abc_reference_number != 'email.body.external_reference')//This is working even if the reference number is empty
{
gs.eventQueue("task.no.externalref.found", targetRec, email.body.external_reference, email.body_text);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 11:15 PM
It's firing the notification all the time.... nothing else is working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 11:17 PM
Put few logs statement to debug