- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 06:13 AM
Hi,
So there is a requirement that if the 'Resolution Code' = Known Error on the incident form then an attachment needs to be mandatory of a Knowledge article. How would I achieve that functionality? To make the (📎) thats on top of the form mandatory, what would be needed?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 02:53 AM
Make a Business Rule as below on the incident table :
(function executeRule(current, previous /*null when async*/ ) {
if (current.hasAttachments() != true) {
gs.addInfoMessage("Please add a relevant knowledge article to proceed!!!");
current.setAbortAction(true);
}
})(current, previous);
Output :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 02:53 AM
Make a Business Rule as below on the incident table :
(function executeRule(current, previous /*null when async*/ ) {
if (current.hasAttachments() != true) {
gs.addInfoMessage("Please add a relevant knowledge article to proceed!!!");
current.setAbortAction(true);
}
})(current, previous);
Output :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 02:04 AM
hi @Amit Verma @snow_beginner - i am new to ServiceNow and working on similar requirement, i have a quick question - can't we use client script for validating attachment while resolving the incident with 'Resolution Code' = Known Error.
just trying to understand if it can be achieve by client side script or need to write business rule as suggested above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 02:18 AM
You can refer below link:https://www.servicenow.com/community/itsm-forum/how-to-check-attachment-before-on-submit-client-scri...
Please note that it requires DOM Manipulation which is not recommended.
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 02:24 AM
thanks a lot @Amit Verma for your quick response!
can you please also help m in understanding which one is preferable as per best practice - BR or client script.