Generate Incident via inbound email action

ivopetrow
Mega Contributor

Hello guys,

I'm trying to use the out of the box Inbound email action (Create Incident) in order to generate incidents to our Quality assurance team when somebody sends an email to them.

Months ago we created a different group in our Production Service Now istance separate from IT.

Users are able to create incidents in the Service Catalog under the QMS group we created , however if they send an email to their address this is not auto-generating an incident.

I'm following the below instructions:

How to create an incident using email

My question is: Can this be setup to generate an incident via email just on the QMS group (quality assurance) we created , not in IT in general.

Production istance is Service Now Istanbul


Email receiving is enabled (however i cannot see any POP3 settings) - not sure if a POP   3 server has been configured.

find_real_file.png

Create incident email action is active but not configured yet

find_real_file.png

I'm not quite sure how exactly to set the Conditions Under Where to run as well as the script.

find_real_file.png

Any help will be appreciated!

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Ivo,



If I understand you want ticket to be assigned to QMS Group & not General IT Group.



Correct me if this is not the case.


Hello Jaspal,



That is correct. I need to create an inbound email action that creates and incident, and then routes it to the appropriate assignment group. In my case that


would be the QMS group.



Is that possible in Istanbul version of Service now?   And do i need a script to run?


Hi Ivo,



You can uses OOB inbound "Create Incident" mark it active true & use below code.



// Note: current.opened_by is already set to the first UserID that matches the From: email address




current.caller_id = gs.getUserID();


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


current.short_description = email.subject;




current.category = "request";


current.incident_state = IncidentState.NEW;


current.notify = 2;


current.contact_type = "email";


current.assignment_group.setDisplayValue('Pass_gorup_name_QMS'); //adds group.




if (email.body.assign != undefined)


    current.assigned_to = email.body.assign;




if (email.importance != undefined) {


    if (email.importance.toLowerCase() == "high")


          current.priority = 1;


}




if (email.body.priority != undefined)


    current.priority = email.body.priority;




current.insert();


Hi Ivo,



If the script above worked you can mark this thread as correct so that it does not appear in unanswered list.