Forward Inbound actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-17-2019 07:06 AM
Hi All,
My requirement for inbound action -Type:Forward, it should update the previously created HR case through inbound email action.
in when to run,below one given
condition as email.origemail.indexOf("myinstnace@service-now.com")==-1
actions:
gs.include('validators');
if (current.getTableName() == "sn_hr_core_case") {
current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
current.work_notes = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
current.update();
}
The instance is receiving my fw email, but its not updating teh case created through my first email to instance(new type alos configured).
Please let me know what do i have to check in this.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2019 03:22 AM
One option would be to add FW: as a reply prefix in your email properties, that way they'll be processed in the same way as replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2019 03:38 AM
I have added FW in glide.email.forward_from_prefix property.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2019 03:58 AM
Not sure what that property is for tbh, try adding it in the glide.email.reply_subject_prefix property.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2019 12:01 AM
Ok, maybe this can help you with further troubleshooting : Troubleshooting inbound email action issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2019 09:30 AM
I have updated my script to get number from subject of email. Now i am able to update the through this forward inbound action.
However, I see one more case created .which means the case in the subject is getting updated(which satisfies my requirement)
I do not want a new case to be created through this forward inbound action.Below is the code i use in actions.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
// Implement email action here
gs.include('validators');
if (current.getTableName() == "sn_hr_core_case")
{
var index = email.subject.indexOf("HRC");
var incNumber = email.subject.substring(index,index+10);
gs.info(incNumber +' test ');
var gr = new GlideRecord('sn_hr_core_case');
gr.addQuery('number',incNumber);
gr.query();
while(gr.next())
{
gs.info('num '+gr.number);
gr.description = email.body_text;
gr.work_notes = "forwarded from: " + email.origemail + "\n\n" + email.body_text;
gr.comments = "received from: "+email.origemail +"\n\n" +email.body_text;
gr.update();
}
}
})(current, event, email, logger, classifier);
I see in the email logs, that new case is created through workflow. (see below screenshot). I donot want that one to be triggered.
Please provide your feedback as I'm stuck in this .