Trying to create task from inbound email action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2014 01:36 PM
I know it's not best practice but I am not the decision maker so.... rather than make our IT personal actually log in to Service Now and create a ticket, management wants them to be able to send an email to a person within IT, CC the servicenow instance and have service now create a task and assign it to the person in the To field.
I have a condition that says: if email.copied = hpincdev@service-now.com
(I copied another inbound action then got help from some people I know, I am not a scripter........yet)
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
var eto = email.direct.split(",");
for(var i=0; i<eto.length; i++)
{
var isUser=getUserFromEmail(eto[i]);
if(isUser){
current.assigned_to = isUser;
break;
}
}
function getUserFromEmail(toemail){
var gr = new GlideRecord("sys_user");
if(gr.get("email",toemail)){
}return gr;}
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 01:28 AM
Hi Tracy,
gs.createUser() is deprecated and not recommended for use.
You can use gs.getUserID() instead.
Best Regards
Tony