How to copy the attachments via Inbound email action into Servicenow Incident table?

Tj14
Tera Contributor

I have a scenario where the attachments on the Incident table should be sent over to the third party via email notifications and I was able to achieve it via email_script.

The main challenge is that if they send an attachment via email to servicenow, how do we copy that attachment into servicenow and associate with its incident opened here. We have an inbound email action defined to read the body of emaiil and reading the data.

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

It should happen automatically by default.

If not, you can perform current.update() in inbound email actiion.

 

If it still not work, please feel free to use GlideSysAttachment() API using copy() method

 

Note: Please mark reply as correct / helpful if it answers your question

View solution in original post

16 REPLIES 16

Where do I use this code? i can understand the code but we have to achieve it via inbound email action written on our INCIDENT table

In inbound action, there is a form section 'Actions' and in that you can write this script.

Thank you very much. It worked perfectly for me.

Deepak Ingale1
Mega Sage

It should happen automatically by default.

If not, you can perform current.update() in inbound email actiion.

 

If it still not work, please feel free to use GlideSysAttachment() API using copy() method

 

Note: Please mark reply as correct / helpful if it answers your question

I'm adding to this, because this wasn't happening automatically for me - I tried some scripting fixes with GlideSysAttachment, but they didn't work. For me, the problem was the glide.attachment.extensions property. The attachment that was coming in via email wasn't one of the allowed extensions.

Once I added the extension to the glide.attachment.extensions property, everything worked automatically as expected.

Hope this helps someone out there!