Update Ticket on Inbound forwarded mails

JohnnySnow
Kilo Sage

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

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.
1 ACCEPTED SOLUTION

Pedro Grilo1
Mega Sage

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

 

 

View solution in original post

3 REPLIES 3

Pedro Grilo1
Mega Sage

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

 

 

Community Alums
Not applicable

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

Community Alums
Not applicable

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.