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

Get attachments when ticket is created from third-party via integration

Vamshi_ch123
Tera Contributor

Hi All,

 

When a ticket is created from third-party servicenow, I want to fetch any attachments associated with it. We are using Integration Hub and have various attachment-related actions available.

Could you please advise which specific action should be used to fetch the attachments in this scenario?

 

Thank you

 

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Vamshi_ch123 

did you check the docs for what each action does and which one suits your requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

JavierPM
Tera Contributor

Hi @Vamshi_ch123, I'm the community manager at Exalate.

 

The usual way to fetch files is by using the attachment-related actions in IntegrationHub. Typically you’d call “Get Attachments” with the ticket’s sys_id to retrieve metadata and then “Download Attachment” if you need the actual file content. One thing to keep in mind is that attachments may not always be available right at the moment the ticket is created, depending on how the external system sends them, so sometimes it’s more reliable to trigger on the Attachment table insert to make sure nothing is missed.

 

Some teams that run into these challenges prefer using an integration solution like Exalate to automatically sync records, including attachments, between ServiceNow and other tools. That way, the process is seamless without having to manage attachment retrieval manually.

 

Hope this helps!

Vishal36
Mega Guru

Hi @Vamshi_ch123

To fetch attachments from a ticket created in a third-party ServiceNow instance using Integration Hub, you’d typically use the “Get Attachments” action to list the attachments linked to that record. Then, you can use “Get Attachment Content” to retrieve the actual files.

You’ll need to provide the table name and the record’s unique ID (sys_id) to these actions, so they know exactly which attachments to fetch.

If your integration involves multiple systems or requires deep data sync ( attachments, comments, etc) reliably across platforms, using an integration approach that manages attachments and data consistently can simplify things and reduce errors.

You may want to consider enterprise grade integration platforms like OpsHub Integration Manager (OIM), a ServiceNow Partner that are built to handle such cross-system bidirectional synchronization smoothly, helping ensure attachments and other critical data move accurately between ServiceNow instances or other tools. All this without writing a line of code 🙂

 

Hope that helps! Let me know if you want to dive deeper into this.

Ajay_Chavan
Kilo Sage
Integration Hub Attachment Actions
Primary Action: "Get Attachments"
Action Name: Get Attachments
Purpose: Retrieves list of all attachments for a specific record
Input: Table name + Record sys_id
Output: Array of attachment metadata (name, size, sys_id, etc.)

Secondary Action: "Download Attachment"
Action Name: Download Attachment
Purpose: Downloads actual attachment file content
Input: Attachment sys_id
Output: File content (base64 encoded)

Recommended Flow

Step 1: Use "Get Attachments"
Input:
- Table: incident (or your ticket table)
- Record ID: [sys_id of created ticket]

Output:
- List of attachments with metadata
Step 2: Loop through results + "Download Attachment"
For each attachment from Step 1:
- Use "Download Attachment" 
- Input: attachment.sys_id
- Save file content as needed


Answer: Use "Get Attachments" first, then "Download Attachment" for each file.

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****