Update Request Item with Inbound Email Action.

karthikbabu
Giga Expert

Hi All,

 

I am working on a requirement.

An email will be received by vendor (email subject doesn't consists of RE or FWD). The email subject consists of the RITM number as "XXX Quote Confirmation: Quote Ref. RITMnumber [EXTERNAL]". This should update the appropriate RITM with the attachment that is coming from the email. I have tried several methods from community but all solutions creates a new RITM instead of updating existing RITM with attachment. 

PLEASE NOTE THAT EMAIL SUBJECT DOESN'T CONSISTS OF "RE" OR "FWD".

Please suggest.

Thank you,

Karthik

8 REPLIES 8

Appreciate your response.

 

I tried as per your suggestion but id didn't worked.

find_real_file.png

I have the below script in the action.

 

"gs.include('validators');

if (current.getTableName() == "sc_req_item") {
//current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.comments = "reply from: " + email.origemail;

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;
}
//// script for copying attachment from email to RITM
var sourceSysID = email.sys_id;
var targetSysID = current.sys_id;
var copyAtt = new GlideSysAttachment();
copyAtt.copy('sys_email',sourceSysID, 'sc_req_item',targetSysID);
//// script for copying attachment from email to RITM

current.update();
}"

 

The action is creating a new call ticket when email subject has "FW:" and does nothing if email subject has "FWD:" or subject has "XXX Quote Confirmation: Quote #xxx/P.O. Ref. RITM0151193". Please suggest if anything wrong in my action.

 

Thanks you,

Karthik

To clarify, I simply said to make the type of inbound action as reply, not new, to avoid having a new record created. If your script isn't working, then that's an entirely different issue and not related to my suggestion working or not.

You said in your original post that:
"email subject doesn't consists of RE or FWD"

So I'm not sure why we're talking about the subjecting containing forward. A forward inbound action is a separate discussion.

If the subject has: "XXX Quote Confirmation: Quote #xxx/P.O. Ref. RITM0151193" and it's not doing anything...then something in your script is causing that.

You'd need to navigate to your sys_email records and look for this particular inbound email and see what the logs say is going on. It'll tell you which inbound actions it's skipped and if one is found and they used it...it'll tell you if the record was updated or not.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi, just wanted to check-in on this. Please mark my reply Correct if that answered your question and any others as Helpful as that helps show your question as resolved, gives credit to the posters and lets other users who may have the same question see the correct answer faster.

Thanks so much!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Sneha Agase
Kilo Contributor

HI Karthik,

Did you got the problem solved.

I am also getting similar kind of issue while Receiving the email to update the requested item.

can you please share what you found or how you solved the issue with updating a record.

 

Regards,

Sneha