Inbound Email Action - Target is empty and message 'did not create or update incident using current'

Mario25
Giga Expert

Hello, 

I have an inbound action rule that is properly finding and updating my incident but two things are missing. 

1 the target is empty on the email log.
2. the email doesn't get attached to the incident as email received.

///----------------------------------------------------------

 gs.include('validators');

var incNum = email.subject.substring(32,42); //get incident number from email subject

if((email.subject.indexOf("Received") > -1) ) 
{
var incident_num_rec = new GlideRecord('incident'); 
incident_num_rec.addQuery();
incident_num_rec.addQuery('number', incNum); 
incident_num_rec.query(); 
if(incident_num_rec.next())
{
incident_num_rec.work_notes = "An email was received from Ricoh Support and forwarded to this ticket";
incident_num_rec.comments = "A Ricoh support call has been opened";
incident_num_rec.u_fournisseur_externe = "Ricoh";
incident_num_rec.state = 3;
incident_num_rec.hold_reason = 4;
incident_num_rec.update();
}
}

else
{
state = stop_processing;

///----------------------------------------------------------

 

Any help would be appreciated.

Thanks,

MjF

1 ACCEPTED SOLUTION

After reviewing a dozen times I realized you wanted my gr.  Updated the lines:

sys_email.target_table = "incident";
sys_email.instance = incident_num_rec.sys_id;
sys_email.update();

and it DOES ATTACH MY EMAIL.

Thank you @Ashutosh Munot .

MjF

View solution in original post

6 REPLIES 6

After reviewing a dozen times I realized you wanted my gr.  Updated the lines:

sys_email.target_table = "incident";
sys_email.instance = incident_num_rec.sys_id;
sys_email.update();

and it DOES ATTACH MY EMAIL.

Thank you @Ashutosh Munot .

MjF

HI,

Thanks mark my answer correct if satisfied.


Thakns,
Ashutosh