Create multiple ticket using one inbound email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2023 06:07 AM
I have a requirement, for the incoming email using inbound action, multiple tickets should be created for Purchasing table. The condition depend on the attachment of the incoming email. So inbound action have to check, if incoming email have more than one pdf attachments, those many number of records need to get created. And instead of getting all attachments coming with the incoming email, getting attached to one single record, this should attach individual PDF doc to corresponding tickets. For example: PDF1 should only be attached to Ticket1, PDF2 should be attached to Ticket2 and so on.
I have been able to implement first half of requirement, I am looking for some help for second half, where I need to frst stop the OOB functionality to attach all incoming attachments to get attached to the target record. Secondly I have to query these PDF files and attach it one on one.
Major Challenge: Due to OOB functionality within after few minutes of inbound action getting trigger, the table sys_id value of the attachment table changes from that of incoming sys_email record to the target record,where all the attachment gets attached. I have details of these attachments available in sys_email_attachment table but from there I am unable to copy the attachment individually to the target record getting created.
I have attached the code snippet, please suggest how can I achieve the requirement

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 04:07 AM
Hi @stayyaba,
Yes with flow designer you can copy single attachments.
The attachment spoke is very self explanatory.
Look up email attachments action (servicenow.com)
Lookup Attachment action (servicenow.com)
Copy Attachment action (servicenow.com)
The GlideSysattachment copy always copies all attachments for a record.
The link I gave you contains code which makes it possible to also just copy 1 attachment. However, I would still recommend to go with the flow. 😉
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.