- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 01:24 AM
Hi Team,
OOTB there is a forward inbound action which creates an incident. I was wondering if we can modify it to update the records instead of inserting the record.
So the requirement is, if the user forwards a mail and it has watermark, then the same incident should be updated instead of creating a new incident.
I tried to change "current.insert" to "current.update" but it doesnt seem to work.
Please help
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 04:44 AM
Hi!
Forwarded emails are, by default, treated as NEW and, for that reason, will try creating a new record.
You can find additional details on this support KB:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0855452
I hope it helps!
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 04:44 AM
Hi!
Forwarded emails are, by default, treated as NEW and, for that reason, will try creating a new record.
You can find additional details on this support KB:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0855452
I hope it helps!
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2022 06:16 AM
Hello Johnny,
By default, forwarded emails are treated as NEW. So will try creating a new record.
Could you please try below code. I have wrote this code to update worknotes.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
var id = email.body.email_incident;
var inc = new GlideRecord('incident');
inc.addQuery('number', id);
inc.query();
if(inc.next()) {
inc.work_notes = "this is a comment3333";
current.update();
}
})(current, event, email, logger, classifier);
Please let me know if it works.
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Thanks & Regards,
Akshay Kangankar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 11:41 PM
Hello,
Have you checked above solution? Please let me know if you need any help.
If my answer helped you in any way, please then mark it as Correct/helpful.