Target field in mails in inbound email action is empty and incident is not getting created.

purnendu
Tera Contributor

I have configured the system to create an incident whenever an email is sent to our ServiceNow instance. Specifically, I sent an email from my Gmail account to dev****@servicenowdeveloper.com with the subject line "Create Incident" and the body containing "TEST12."

However, I noticed that in the System Logs under Mail, the Target Field (Instance) is showing as empty, and no incident is being created as expected.

Could you please provide guidance on how to resolve this issue? Any insights or suggestions would be greatly appreciated. I am attaching the screenshot of it.

Thank you in advance for your assistance.

3 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@purnendu 

ideally with current.insert() it should set

don't use this line current.instance and remove it

but use these lines to set the target if it's empty

See if this works, also ensure you fill any mandatory fields on incident if there are any which are made mandatory via data policy

If you don't set the mandatory fields then system will stop the insertion

var sysId = current.insert():
sys_email.target_table = 'incident';
sys_email.instance = sysId;
sys_email.update();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

@purnendu 

Looks like email filter is the culprit here.

Navigate to All > System Mailboxes > Administration > Filters

Probably one of those filters are causing the issue. Check and be careful on updating those records as you might be ending up with security issues and unwanted emails.

 

Accept the solution and mark as helpful if it does.

Regards,

Sumanth

View solution in original post

@purnendu 

since your inbound email action is getting ignored, it's not creating INC and hence not populating the target field

there is already 1 OOTB inbound action on incident table of type "New", see below if that's getting processed

When you receive the email it will show the inbound actions processed on that email record.

AnkurBawiskar_0-1746521572090.png

 

If that's getting executed then is it creating INC?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

9 REPLIES 9

@purnendu 

did you check your inbound action is getting processed or not?

Any email filter is blocking it from getting executed?

Email filters 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 Despite implementing your suggestions, I am still facing challenges with the target not being populated, and the incident is not being created as expected. Additionally, I have confirmed that all necessary plugins are installed, and the email type is being received as "received-ignored."

I have attempted various troubleshooting steps but have not achieved the desired outcome. Could you please provide further guidance or any additional insights that might help resolve this issue?



@purnendu 

since your inbound email action is getting ignored, it's not creating INC and hence not populating the target field

there is already 1 OOTB inbound action on incident table of type "New", see below if that's getting processed

When you receive the email it will show the inbound actions processed on that email record.

AnkurBawiskar_0-1746521572090.png

 

If that's getting executed then is it creating INC?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

purnendu
Tera Contributor

@Ankur Bawiskar @SumanthDosapati 

 

 

This is to inform you that the incident has been successfully created, and I achieved the desired outcome.

With your invaluable assistance, I disabled the "Junk email - sender equals recipient" filter, and subsequently implemented Ankur's code. This approach worked exceptionally well.

Thank you both for your contributions to this process. Your support was greatly appreciated.

Thanks and Regards.
Purnendu.



@purnendu 

Glad to help.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader