Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Attachment not getting added in SC task record through Email reply

Ashwin Perumal1
Tera Contributor

Hi All,
When a user replies to an email sent from the SC Task and the user is adding attachment on their response the attachment is not getting added to SC Task but I could see the response email body visible to me in the activity stream of the SC Task. How could I solve the issue such that attachment is also added to the SC Task record.

Can someone pls help on this.. Thanks in Advance.

1 ACCEPTED SOLUTION

Hi @Ashwin Perumal1,

 

When you go to sys_email list, you can find the message which was received.
In the Email log related list, you can find how it was processed.

 

PeterBodelier_0-1696408600610.png

 

You could use a script like below to get the emails attached:

var sysAttach = new GlideSysAttachment();   
var emailSysId = sys_email.getUniqueValue(); 
if (emailSysId) { 
   var sysEmailAttachments = sysAttach.getAttachments("sys_email", emailSysId); 
   while (sysEmailAttachments.next()) { 
         sysEmailAttachments.setValue("table_name", current.getTableName()); 
         sysEmailAttachments.setValue("table_sys_id", current.getUniqueValue()); 
         sysEmailAttachments.update(); 
   } 
} 

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

5 REPLIES 5

Peter Bodelier
Giga Sage

Hi @Ashwin Perumal1,

 

How are you processing the emails? Are you using OOTB or custom Inbound Actions or Email flows?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Ashwin Perumal1
Tera Contributor

@Peter Bodelier 
I am using OOTB Inbound Actions only. I could see  there is no Inbound Action for sc_task table as per OOB. So I want to  understand how the Email response body alone is visible t in SCTask in activity stream but not the attachment from mail to SC Task record. 

Can u help me understand this. Thanks in Advance.

Hi @Ashwin Perumal1,

 

When you go to sys_email list, you can find the message which was received.
In the Email log related list, you can find how it was processed.

 

PeterBodelier_0-1696408600610.png

 

You could use a script like below to get the emails attached:

var sysAttach = new GlideSysAttachment();   
var emailSysId = sys_email.getUniqueValue(); 
if (emailSysId) { 
   var sysEmailAttachments = sysAttach.getAttachments("sys_email", emailSysId); 
   while (sysEmailAttachments.next()) { 
         sysEmailAttachments.setValue("table_name", current.getTableName()); 
         sysEmailAttachments.setValue("table_sys_id", current.getUniqueValue()); 
         sysEmailAttachments.update(); 
   } 
} 

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

@nowgpt1 I cannot seem to find the property "glide.email.read.multipart". I can only find this property "glide.email.read.active" which is also set to true by default. So, the only solution I see is to create a custom Inbound Email Action that specifically handles attachments for SC Tasks.