The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Attachment in inbound email does not get attached to the scoped app record

Binglin Huang
Tera Expert

Working on a scoped app atm. Trying to add attachment to a record by replying the notification with attachments. The inbound email is added to the correct record, but the attachments are not.

 This reply should have an attachment but it is not added to the record. Below are some locations I checked. Running out of ideas. Any suggestion is appreciated.find_real_file.png

Email log has no error:

find_real_file.png

Attachment table shows it is attached to sys_email (??!) where it should be the scoped table

find_real_file.png

Recieved email shows the attachment is recieved 

find_real_file.png

1 ACCEPTED SOLUTION

Binglin Huang
Tera Expert

Ok, I gave up. I finally got around this by creating an inbound action in the global app. The workaround only adds one more update set to promote on top of the scoped app to another instance. I think it is not bad giving that it works.

I was trying to find out if there is a way to made it work in scoped app, but seems it is "as designed" in SN. I was chasing a ghost..

 

View solution in original post

12 REPLIES 12

Voona Rohila
Kilo Patron
Kilo Patron

Hi Binglin Huang

You should use below logic in your inbound action to copy the attachments from sys_email table to your table.

syntax:

GlideSysAttachment.copy('sourcetable','sys_id','destinationtable','sys_id');

example:

GlideSysAttachment.copy('sys_email', sys_email.sys_id, 'incident', incident.sys_id);

https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/r_SGSA-copy_S_S_S_S

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/script/useful-scripts/reference/r...


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Thanks for the response. I would expect the OOTB functionto do this for me rather than I need to create my own inbound action. Is that not the case?

i tried this but dont work unfortunately
i tried using it with curent.insert and current.update().

im trying to get the attachments from the email to be attached to the incident that will be created.

this is the expected output (please see screenshot below)

 

this is what i have in the inbound actions.(please see attachemnt

 

 

 

 

Binglin Huang
Tera Expert

What I mean is, adding the replied email contents and attachments to the activity log of the matching record should be an platform wide function regardless scoped or global. Unless my understanding is wrong.

It works well for incident, but I am not sure if it is because there is a secret inbound email action defined for this table. I could not find anything that contains attachment codes in OOTB inbound actions.

From the behaviour I can see SN is alredy doing it - have the replied email content added to the activity log. But why are attachment left out? Is that a supposed to work feature but did not work as defect? or there is some thing stopping it from working where I need to configure?