No incident is created from inbound email action

thomaskennedy
Tera Guru

I have an inbound email action named 'Create Incident' in our dev environment where I'm an admin. It is the only active inbound action by that name. This action runs when the Subject starts with 'Submit'. When I send an email in from prod, the action runs (as me) but no incident is created. When I open the received email and check the Email Log it reads like so:

...

2017-01-16 09:02:12 Skipping 'Update Request Item', email is type 'new', which does not match Inbound Email Action's type 'reply'

2017-01-16 09:02:12 Processed 'Create Incident', created incident :INC0399879

2017-01-16 09:02:11 Skipping 'Create Story', condition 'email.subject.indexOf("Story:") == 0' failed

2017-01-16 09:02:01 Ready for update

No incident is created and I see no error message anywhere.

The only required fields on incident are description and short_description, and these are populated like so:

current.short_description = email.subject;

current.description = email.body_text;

When I add gs.info() statements, all of them run, including any I put after the call to current.insert(). This suggests that no exception is occurring on that line.

We are on Helsinki, build date 11-08-2016_1607.

This action is a copy of an inactive one I found in the system. I don't know if that one was ever active or if it worked.

What can I do to troubleshoot this?

18 REPLIES 18

Michael Fry1
Kilo Patron

Your script will also need current.insert(); - at the end so it inserts a record. Looks like your getting a number, but the incident isn't getting created.


Yes it is calling insert. Here it is without the gs.info() statements. I hard-coded the values for cmdb_ci, impact and urgency in case there were some rule requiring a value for them.



var subject = email.subject;



current.caller_id = gs.getUserID();


current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;



current.short_description = email.subject;


current.description = email.body_text;



current.category = "request";


current.incident_state = 1;


current.notify = 2;


current.contact_type = "email";



if (email.body.assign != undefined)


    current.assigned_to = email.body.assign;



if(email.importance != undefined)


    if (email.importance == "High")


          current.priority = 1;



if (email.body.priority != undefined)


    current.priority = email.body.priority;



current.cmdb_ci= '44d62b0b6f20e900256cb50d5d3ee40f'; // Filemaker


current.impact=3;


current.urgency=3;



current.insert();


How are you handling: Subject starts with 'Submit'.



email.subject.toLowerCase().indexOf('submit') >= 0;


The condition is email.subject.startsWith("Submit")