Service Manager / Service Center Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Send email through JS after update ess call

Highlighted
Luciano80RJ
Regular Collector

Send email through JS after update ess call

Hi,

 

I want send a email notification to a assignment group when the end user update the ess call.

I've tried through of notifications and macro and without success.

I put a JS in display options "cc.edit.incident" on the Save & Exit button because this action changes the Incident Status from Pending Customer to Open, but I want to notify the assignment group:

 

var file = system.vars.$file;
var imid = file.incident_id;

var Vrel = new SCFile('screlation');
var Srel = Vrel.doSelect("source=\""+ imid +"\" and depend.filename=\"problem\" and depend.active=\"true\"");

if (Srel == RC_SUCCESS)
{
var incid = new SCFile('probsummary');
var selincid = incid.doSelect("number=\""+Vrel.depend+"\" and problem.status=\"Pending Customer\"");
if (selincid == RC_SUCCESS)
{

incid.problem_status = "Open";
incid.doUpdate();
print("The incident "+Vrel.depend+" has been update, it status is Open now.");

}
else
{
print("Ocorreu um erro ao processar!");

}

}

 

How could I do it?

2 REPLIES
Piku
Honored Contributor

Re: Send email through JS after update ess call

You should use the notification for this purpose. What is the issue you are getting in this.

____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Luciano80RJ
Regular Collector

Re: Send email through JS after update ess call

Because the update action is in Interaction, when the end-user does an update the interaction, the Incident changes it status automatically to "Open", through this JS.

//Add this to "OnDomLoad" event