Inbound action is creating calls instead of incidents from report phishing feature in outlook

nishtha9
Tera Contributor

Inbound action is creating calls instead of incidents from report phishing feature in outlook

 

script in action

 

//  Note: current.opened_by is already set to the first UserID that matches the From: email address
//var aGroup = "";
var wList = [];
var recipients = email.to.toString().split(',');
//gs.log("Recipients: " + recipients);

current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;

current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";

/*if (email.to.toString().indexOf('labs-help@optiv.com') > -1){
    aGroup = "ce96192b";  //Lab Support Group
}
else{
    aGroup = "e9619b9";  //Service Desk Group
}*/

for (var x = 0; x < recipients.length; x++){
    var usr = new GlideRecord('sys_user');
    usr.addQuery('email', recipients[x]);
    usr.query();
    if (usr.next()){
        wList.push(usr.sys_id);
    }
}
//gs.log('Watch List: ' + wList.toString());
current.watch_list = wList.toString();

//aGroup = gs.getProperty('self_service.incident.service.desk');  //Service Desk Group
//current.assignment_group = aGroup;

//commented as the incidents are by default assigned to service desk
/*
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();


2 REPLIES 2

Amit Verma
Kilo Patron
Kilo Patron

Hi @nishtha9 

 

Could you please let me know what do you mean by calls ?

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Call means call record