HTML code to link to download a Knowledge Article's attachment and/or download a Attachment link KB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 11:06 AM
The goal is to link within the task's long description to download a file saved in one of these ways...
a. the attachment on a knowledge article (KB's Display Attachment = TRUE)
b. the attachment link knowledge article (KB's Attachment Link = TRUE)
Current state & problem statement: The task's long description is linking to a knowledge article but the issue with the current HTML code (see attachment: Task description_HTML) is when the user clicks the link (see attachment: Task description), it takes them to the normal knowledge article content page and the user would have to know to download the KB's attachment. I have tested updating the KB setting to make the KB an Attachment link (Attachment link = TRUE) but the link doesn't download the file (it just loops the user to the blank knowledge article and then loops them to the ESC homepage).
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 04:05 PM
Instead of using the URI to the knowledge article, try using attachment API as a uri to link.
1. Attachments information is saved in sys_attachment table (enter "sys_attachment.list" in the Navigator). Filter on "Table name = kb_knowledge" and "Table sys ID" = sys_id of the knowledge article and "File name" = file name of the attachment. Right click on the row and select "Copy Sys_id".
2. Open REST API Explorer. From Navigator, "System Web Services" > "REST" > "REST API Explorer".
In "API Name", select "Attachment API" and select "Retrieve attachment content (GET)".
In the "sys_id", paste the sys_id of the attachment copied in step 1 and click the "Send" button.
3. Below the "Send" button, there should now be a "Request" section. Copy this URI and use it in the "<a href=" link.