- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:05 AM
Hide Remove button on attachment when incident/problem/change state is closed via ACL to restrict deletion of the attachment.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:20 AM
Hello @Sehreen !
An onLoad Client Script that utilizes g_form.disableAttachments() prevents users from adding or removing attachments through the UI. Note that existing attachments remain visible. So the Attachments popup will look like this:
Please consider marking my answer as helpful and accepting it as the solution if it assisted you in any way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:40 AM - edited 08-18-2025 12:46 AM
Create a client script to disable attachments when task state is resolved. Below is a sample Client Script created for Incident table, same logic can be applied to task table with condition tasktype [sys_class_name] is one of Incident, Problem, Change and State conditions.
function onLoad() {
//Type appropriate comment here, and begin script below
var incStatus = g_form.getValue('state');
if(incStatus == 6)
{
g_form.disableAttachments();
}
}
Please note, this feature is not supported on mobile devices and below is the workaround,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0682392
Alternate option is to change out of box ACLs but is not recommended due to complexity.
If this helped to answer your query, please accept the solution and close the thread.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 01:14 AM
Hi @Sehreen
In client script try to find by “(BP) Hide Attachment Link when Closed” see if False. If yes change to True
The ServiceNow already have a condition to avoid attached
See reference
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0696020
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:20 AM
Hello @Sehreen !
An onLoad Client Script that utilizes g_form.disableAttachments() prevents users from adding or removing attachments through the UI. Note that existing attachments remain visible. So the Attachments popup will look like this:
Please consider marking my answer as helpful and accepting it as the solution if it assisted you in any way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 12:40 AM - edited 08-18-2025 12:46 AM
Create a client script to disable attachments when task state is resolved. Below is a sample Client Script created for Incident table, same logic can be applied to task table with condition tasktype [sys_class_name] is one of Incident, Problem, Change and State conditions.
function onLoad() {
//Type appropriate comment here, and begin script below
var incStatus = g_form.getValue('state');
if(incStatus == 6)
{
g_form.disableAttachments();
}
}
Please note, this feature is not supported on mobile devices and below is the workaround,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0682392
Alternate option is to change out of box ACLs but is not recommended due to complexity.
If this helped to answer your query, please accept the solution and close the thread.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 01:14 AM
Hi @Sehreen
In client script try to find by “(BP) Hide Attachment Link when Closed” see if False. If yes change to True
The ServiceNow already have a condition to avoid attached
See reference
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0696020
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 03:35 AM
These were helpful. Thank you!