Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2015 02:15 AM
Okay, we were checking for from address but you mentioned that assignment should be on basis of To Address. Following code should work.
- // Define Caller Details
- var callerID = gs.getUser().getRecord();
- var sEmailAddress = email.direct.toLowerCase();
- if (sEmailAddress.indexOf("ithelpdesk@conns.com") != -1) {
- current.assignment_group.setDisplayValue("IT Helpdesk");
- }
- else if(sEmailAddress.indexOf("security@conns.com") != -1){
- current.assignment_group.setDisplayValue("IT Securities");
- }
- current.caller_id = callerID.getValue('sys_id');
- current.location = callerID.getValue('location');
- current.u_phone_number = callerID.getValue('phone');
- current.contact_type = 'email';
- // Define Incident Details
- current.status = 1;
- current.short_description = email.subject;
- current.description = email.body_text;
- current.insert();