fews attachments are not attaching in the Hr case

chandan31
Tera Contributor

Hi All,

 

 

In the Hr case table, some of the attachment are attaching in the hr case via inbound action but some of the attachment are not attaching the hr case and i am receiving this error in the email log:

 

chandan31_0-1692184171577.png

 

3 REPLIES 3

Community Alums
Not applicable

Hi @chandan31 ,

What is the error?

 

Hi ,

 

I have attach the screen shot in that attachment is empty showing.

 

Karthiga S
Kilo Sage

Hi @chandan31 

 

This issue could be due to several reasons such as size limit of the attachment, file type restrictions, or issues with the inbound action script. Here are some steps to troubleshoot and resolve the issue:

 

1. Check Attachment Size Limit:
- ServiceNow has a default attachment size limit. If the attachment size exceeds this limit, it will not be attached to the HR case. You can check the system property "glide.attachment.max_size" to see the maximum attachment size.

 

2. Check File Type Restrictions:
- ServiceNow allows you to restrict certain file types from being attached. Check the system property "glide.attachment.mime_type_blacklist" to see if the file type of your attachment is listed.

 

3. Review Inbound Action Script:
- There might be an issue with the inbound action script that is causing the attachment not to be attached. Review the script to ensure it is correctly written and functioning as expected.

 

4. Check Email Log:
- The error message in the email log can provide more information about why the attachment is not being attached. Analyze the error message to understand the root cause of the issue.

 

5. Update Inbound Action Script:
- If the issue is with the inbound action script, you might need to update it. Here is a sample script for attaching files from an email to a record:

 

var inputStream = email.body.getInputStream();
var attachment = new GlideSysAttachment();
attachment.write('incident', current.sys_id, email.subject, 'text/plain', inputStream);


6. Test the Solution:
- After making the necessary changes, test the solution by sending an email with an attachment to see if it gets attached to the HR case.

 

Remember to always test in a sub-production instance before making changes in the production instance.

 

Please mark it Correct and Hit Like if you find this helpful!

 

Regards,

Karthiga