Inbound Email Action to Create Incident and Route to Assignment Group

Heather White
Mega Guru

Good morning Community,

    I need to create an inbound email action that creates and incident, and then routes it to the appropriate assignment group.   I have set up the field actions(shown below), and the inbound action is working-sending all mail to our generic Service Desk group.   I need to customize this action to route incidents to specific assignment groups based on the email address of the sender. I need some assistance creating a script to accomplish this task.

Thanks!

Heather

find_real_file.png

3 REPLIES 3

manikorada
ServiceNow Employee
ServiceNow Employee

In the script you can have something like :



if(email.origemail == '<<email address>>')


{


current.assignment_group = '<<sys_id of the assignment group>>';


}


curr


Dubz
Mega Sage

Hi Heather,



If you create a new table mapping email addresses and the assignment groups associated with them then you can add some script to your 'create incident' inbound email action to define which assignment group is added to the Incident when it is created.



A function like this might work:



function getAssignmentGroup() {



var gr = new GlideRecord("your_new_table_name");


gr.addQuery("u_email_address", email.origemail);


gr.query();


if (gr.next()) {


return gr.u_assignment_group;


}


}



then you can just add the below elsewhere in you create incident action



current.assignment_group = getAssignmentGroup()


basavakiran
Tera Contributor

@Dubz 

 

How to create a new table mapping email addresses and the assignment groups associated with them Can you please help