Inbound action to update Case from a Froward email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2020 08:53 AM
Hi,
We would like to be able to update Cases and Incidents from emails that have been forwarded.
If an end user forwards an email with the watermark and ref number in the subject then we want the case or incident to be updated just like a reply email does.
I have tried to create a new inbound action with the type set of forward and use the same code from the "Update Case via reply" but it doesn't update the case, instead it creates a new case.
I would appreciate any help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2020 09:13 AM
Hi Chris,
Please find the inbound action which is responsible for creating case and make sure your new inbound action order is less than that so that your update inbound executes first.
You can find the inbound action which is creating case using the email log of the test fwd email which you sent to service now.
Test again after making above change and also find about the execution of your new inbound action whether it's processed or skipped from the email log of the test fwd email which you sent to service now so that you can take appropriate action.
If it helps, please mark ✅ Correct and 👍 Helpful.
Thanks & Regards,
Madhav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2020 09:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2020 10:02 AM
Hi Chris,
The only difference in inbound actions for fwd and reply type email actions is Type field on When to run section of inbound action. I'm sure you kept that as Forward instead if Reply.
Coming to the Actions section of Inbound action, can you add any log statements to the code like gs.log() to find out from system logs (system logs-> system log-> All) whether inbound action is executing or not.
Also can you share snapshot of email log from system logs -> emails and select the test email you send to instance and scroll down to see the email log. You should see something like in the pic below.
If it helps, please mark ✅ Correct and 👍 Helpful.
Thanks & Regards,
Madhav.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2020 10:45 AM
Hi Madhav,
I have attached a screen shot of the email log. and also a copy of the code in the Email action that I have created.
Hope this helps you see what I'm trying to do and what is not working.
If there is anything else I can provide you with please let me know.
Thanks
//if case.state = resloved (6), then check first word in body for accept or reject
//else if case.state = Awaiting (18), then, move to open state
var case_state = current.state;
if (current.state == 6) {
var lines = email.body_text.split('\n');
var firstword = "";
if (lines.length > 0)
firstword = lines[0].replace(/^\s+|\s+$/g,'');
firstline = firstword.toLowerCase();
if (firstline) {
if(firstline.indexOf("reject") == 0)
current.state = 10;
else if(firstline.indexOf("accept") == 0)
current.state = 3;
}
} else if (current.state == 18) {
current.state = 10;
} else{
current.sys_updated_on = "";
}
current.update();