Copy of attachments from case to case task in csm workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi, I have a few requirements that I need some help or suggestions from community
In CSM Workspace:
Given an attachment is added to a parent case.
When a case task is created from that parent.
Then a visual indicator (e.g., an attachment icon or badge) must appear on the case task workspace form.
And the attachment icon must show the total number of attachments on the parent case.
And clicking on the attachment icon must open a list showing the parent case attachments.
And a user must be able to click on an attachment from this list to view or download the original file.
And adding an attachment to the case task must not duplicate the original attachment from the parent case.
So can anyone share your ideas on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Suggested Implementation Approaches
1. Create a Related List or “Attachment Viewer” Component
-
In Workspace (Agent Workspace/CSM Workspace), you can add a custom component to the Case Task form.
-
This component would:
-
Query the sys_attachment table.
-
Filter by table_sys_id = parent_case.sys_id.
-
Display results in a modal/list with download links.
-
This avoids physically copying attachments — you’re just referencing the parent’s.
2. Add a Visual Indicator (Icon + Count)
-
Create a UI Formatter or Workspace Component (e.g., a small “paperclip” icon with a badge).
-
Logic:
-
On form load, run a GlideAjax that counts attachments on the parent case.
-
Example query:
var gr = new GlideAggregate("sys_attachment"); gr.addQuery("table_sys_id", parentSysId); gr.addAggregate("COUNT"); gr.query(); if (gr.next()) return gr.getAggregate("COUNT"); -
Display this count as a badge (like how worknotes/comments badges appear).
-
3. Click → Show Parent Attachments
-
When the icon is clicked, open a modal/side panel showing attachment records.
-
Each row → filename, size, created_by, download action.
-
Download link can simply point to:
/sys_attachment.do?sys_id=<attachment_sys_id>
4. Keep Parent & Child Attachments Separate
-
By design, don’t copy parent attachments when creating case tasks.
-
Case task can still have its own attachments (saved in sys_attachment with its own table_sys_id).
-
In UI, just clearly differentiate parent vs child attachments:
-
Section 1: Parent Case Attachments (read-only).
-
Section 2: Case Task Attachments (native related list).
-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Thanks for your response Ravi gaurav