did not create or update sc_req_item using current in inbound email action.

Uma2
Tera Expert

HI Team,

I want to trigger a notification from the inbound email action.It's not working,Can anyone suggest me why  it is not working.

Here is my script:

var ritmNo ='';
var sub=email.subject;
var req='';
var index = sub.indexOf("RITM");
var end = 11; //length of ritm
if(index > -1) {
end = index+end;
ritmNo = sub.substring(index, end).trim();
gs.log(ritmNo);
}
//if (current.getTableName() == "sc_req_item") {
//if (email.subject.toLowerCase().indexOf("RITM") > -1)
// if(email.from_sys_id == current.u_requested_for)
// {
// req= current.u_requested_for;
// }
var body=email.body_text;
var boo=[];
boo=body.split('________________________________');



var gr=new GlideRecord('sc_req_item');
gr.addActiveQuery();
gr.addQuery('number',ritmNo);
gr.query();
if(gr.next())
{
//gs.eventQueue('Test Email',gr,email.from,finalVal);
if(email.from_sys_id == gr.u_requested_for)
{
req= gr.u_requested_for;
}
var finalVal=sub+"|"+boo[0]+"|"+req;
gs.eventQueue('Test Email',gr,email.from,finalVal);
}
// req=gr.u_requested_for;
//gs.eventQueue('Test Email',current,email.from,finalVal);
gs.log("tttttttttt"+boo[0]);
//current.update();
//}

In email Log.

find_real_file.png

I changed current also but still i am getting same error.

3 REPLIES 3

Kunal Varkhede
Tera Guru

Hi,

 

Have a look below it may help you

https://hi.service-now.com/kb_view.do?sysparm_article=KB0746934

https://hi.service-now.com/kb_view.do?sysparm_article=KB0547763

 

Please Mark Correct/Helpful answer if it help you in any way.

Thanks,

Kunal.

Hi kunal,

 Thanks for the quick response.

No Use with the KB articles.

 

 

Thanks,

Uma. 

Hello Uma,

Were you able to find any solution to this problem?

 

Best Regards,

Amit