Forward Email to create an Incident

Navneet3
Tera Expert
Hi, I need help with Forward inbound email. I have created the email action but the ticket is not getting.

Here is the requirements.

Currently, Users are emailing the manager for ALL their issues. The team is having hard time managing the emails.

The team wants to forward the email to a specific email address which is set (on the exchange) forward to ServiceNow instance.

Please see the attachment (screenshot) the inbound actions.

 

thank you

15 REPLIES 15

Maik Skoddow
Tera Patron
Tera Patron

Hi @Navneet3 

set the following system properties (via "Scripts - Background")

//extended list or subject profixes for handling responses as replies
gs.setProperty(
	"glide.email.reply_subject_prefix", 
	"r:,re:,Re:,RE:,aw:,AW:,fw:,FW:,fwd:,Fwd:,FWD:,wg:,WG:,Wg:,Accepted:,Tentative:,Declined:"
);

//force forwarded emails to be handled as reply emails
gs.setProperty("glide.email.forward_subject_prefix", "-");

//don't recognize any forward patterns within body
gs.setProperty("glide.email.forward_from_prefix", "");	

 

Maik

Hi

The ticket is being created but the category and the assignment group is not being assigned correctly.

sumanta pal
Kilo Guru


Sure, I can help you with that. Here are the steps you need to follow to set up an inbound email action in ServiceNow:

1. Navigate to System Policy > Email > Inbound Actions.
2. Click New to create a new inbound action.
3. Fill in the fields on the form, as appropriate. Here are some important fields:
- Name: Enter a unique name for the inbound action.
- Active: Select this check box to activate the inbound action.
- Target table: Select the table that the inbound action applies to.
- Action type: Select "Create" if you want to create a new record.
- Conditions: Define the conditions that an email must meet for the system to perform the inbound action.
4. In the Script field, write a script to define what action should be taken when an email meets the conditions. For example, you can create a new incident and populate the fields with information from the email.
5. Click Submit to save the inbound action.

Here is a sample script for creating a new incident:

javascript
(function runAction(email, email_action, incident) {
// Create a new incident
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = email.subject;
gr.description = email.body_text;
gr.insert();
})(email, email_action, incident);


Please note that the email address you are forwarding to should be the email address of your ServiceNow instance. Also, make sure that the email server is properly configured to forward emails to ServiceNow.

If the inbound action is still not working, you can debug it by checking the email logs. Navigate to System Logs > Email > Received to see the logs of all received emails. Check if there are any errors related to your inbound action.


nowKB.com

Hi

The ticket is being created but the category and the assignment group is not being assigned correctly.

What could be wrong?