The CreatorCon Call for Content is officially open! Get started here.

Inbound Action Not Working

VanamaAkhil
Tera Contributor

Hi All,

 

I have created a very simple Inbound Action of type Forward.But while Email is recieved ,Iam getting an error "did not create or update interaction using current"Find below screenshot.

 

Thanks in Advanced 

Akhil

7 REPLIES 7

TejasSN_LogicX
Tera Contributor

One-line summary: the inbound action code is not inserting the record (usually because required fields are missing, current.insert() is not reachable, ACLs/canCreate() blocks it, or the inbound action conditions didn’t match) — add defensive logging, ensure required fields (opened_for) and valid sys_ids, and prefer record.initialize()/insert() style to guarantee creation.


try this
Go to System Mailboxes → Inbound Actions, enable the action and Turn on logging (if available) or check System Logs → Emails to see if action matched the incoming email.

Add a simple gs.log('InboundAction hit for: ' + email.from); at top of your script to prove execution.

use this script :

var ir = new GlideRecord('interaction');
ir.initialize();
ir.opened_for = 'd71b87bec3da2d6d1339b6ce0013137'; // validate this sys_id exists
ir.chat_summary = 'received from: ' + email.origemail + '\n\n' + email.body_text;
ir.short_description = email.subject;
ir.type = 'Email';
ir.state = 'new';
ir.assignment_group = 'f07c7de7c3a7d6103d4cf973e4013191';
var sysid = ir.insert();
if (!sysid) gs.log('Interaction insert failed');
else gs.log('Interaction created: ' + sysid);

Bhuvan
Mega Patron

@VanamaAkhil 

 

Can you check your code as it looks like you might have copied from knowledge target table and not applicable to interaction table. Refer below for out of box inbound email action for interaction table, try to replicate for your action and test it.

 

Bhuvan_0-1758527648654.png

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

If I kept the type as NEW in the same inbound email action,then it is working fine.It is creating the Interaction.But it is not working for the type Forward.Iam getting the error.

@VanamaAkhil 

 

Please see if below helps

 

https://www.servicenow.com/community/developer-forum/inbound-action-forward-not-working-when-using-p...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0538137

 

Try to use inbound email flow rather than inbound email action and see if it works.

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan