Multiple tickets being created for the same incident

jobeasow
Mega Contributor

When an incident has more than one customer involved, each person that is replying to the emails is having a ticket created.   Need to know the rule that is updating incidents when emails come in and figure out why they are creating new incidents instead of updating an existing one.   Ideally all the customer involved with an incident, their replies should be update the same incident but here it is creating new tickets for all the users except the original user.

Please help me with this.

1 ACCEPTED SOLUTION

Thanks Pradeep,



I believe this is the inbound email action which deals with the email replies to the incident:



Name: Update Incident (BP)


Target Table: Incident


Type: Reply



This is the script being used:



gs.include('validators');




if (current.getTableName() == "incident") {


  //current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;


  var body = email.body_text;


  var ref = body.match(/Ref:.*[0-9]/);


  var index = body.indexOf(ref) + ref.toString().length;


  var extract = body.substring(0, index);


  current.comments = "reply from: " + email.origemail + "\n\n" + extract;



  if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {


  current.state = "2";


  current.work_notes = "The caller did not feel that this issue was resolved";


  }



  if (email.subject.toLowerCase().indexOf("please close") >= 0) {


  current.state = "7";


  current.work_notes = "The caller has reported the incident has been resolved";


  }



  if (gs.hasRole("itil")) {


  if (email.body.assign != undefined)


  current.assigned_to = email.body.assign;



  if (email.body.priority != undefined && isNumeric(email.body.priority))


  current.priority = email.body.priority;


  }



  current.update();


}


View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Job,



Check for the inbound email actions i.e system policy->Inbound email actions. Here have the filter target table as incident and check for inbound email actions created on your incident.


Thanks Pradeep,



I believe this is the inbound email action which deals with the email replies to the incident:



Name: Update Incident (BP)


Target Table: Incident


Type: Reply



This is the script being used:



gs.include('validators');




if (current.getTableName() == "incident") {


  //current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;


  var body = email.body_text;


  var ref = body.match(/Ref:.*[0-9]/);


  var index = body.indexOf(ref) + ref.toString().length;


  var extract = body.substring(0, index);


  current.comments = "reply from: " + email.origemail + "\n\n" + extract;



  if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {


  current.state = "2";


  current.work_notes = "The caller did not feel that this issue was resolved";


  }



  if (email.subject.toLowerCase().indexOf("please close") >= 0) {


  current.state = "7";


  current.work_notes = "The caller has reported the incident has been resolved";


  }



  if (gs.hasRole("itil")) {


  if (email.body.assign != undefined)


  current.assigned_to = email.body.assign;



  if (email.body.priority != undefined && isNumeric(email.body.priority))


  current.priority = email.body.priority;


  }



  current.update();


}


Hi,



Thanks for the update. You may find the below thread helpful.


https://community.servicenow.com/thread/161858


Deepak Ingale1
Mega Sage

If email being replied is being generated by ServiceNow, it should have a watermark. If watermark is present while replying to incident, it should update incident rather than creating it.