- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:46 PM
I need to ensure there's an attachment to a catalog task, before the task is closed. I know I can make it mandatory with a Catalog UI Script, however this is not appropriate because I need to allow the fulfiller to update the catalog task during fulfillment and the attachment may not be available until after some of these updates.
I'd rather not use (say) a business rule if it needs to refer to a catalog task by Short Description as this is not reliable long-term; I'd like to find something within the catalog item if possible.
I saw something about a Client Script using ajax, but not too familiar with this. Is there a simpler option that runs on the server?
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 03:16 PM
Actually I was able to use a catalog client script I found in the community. I could probably reduce the 10 minutes to less as it's possible the user could submit more than one RITM within 10 mins, each with an attachment. I also found a script that finds attachments and sorts them by created_on in reverse, but I wasn't able to get that one to work.
function onSubmit() {
var grAtt = new GlideRecord("sys_attachment");
grAtt.addQuery("table_name", "sc_cart_item");
grAtt.addQuery("sys_created_by", g_user.userName);
grAtt.addQuery("sys_created_on", '>=', 'javascript:gs.minutesAgo(10)');
grAtt.query();
if (!grAtt.next()) {
alert("You must attach a vendor quote to submit this request");
return false;
}
return true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:50 PM
Hi,
Can you please check below link:
https://community.servicenow.com/community?id=community_question&sys_id=d0febee5db58dbc01dcaf3231f96196d
In this business rule you can add that closed complete condition.
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 12:59 PM
Thanks but I don't think that will work because I have two tasks as part of the RITM and the attachment is only required on close of the second task, so the criteria has to be task specific not RITM or CATITEM specific. Am I missing something in your suggested solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2018 01:55 PM
Then you have to create script includes and client script to achieve this.
Thanks ,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 03:16 PM
Actually I was able to use a catalog client script I found in the community. I could probably reduce the 10 minutes to less as it's possible the user could submit more than one RITM within 10 mins, each with an attachment. I also found a script that finds attachments and sorts them by created_on in reverse, but I wasn't able to get that one to work.
function onSubmit() {
var grAtt = new GlideRecord("sys_attachment");
grAtt.addQuery("table_name", "sc_cart_item");
grAtt.addQuery("sys_created_by", g_user.userName);
grAtt.addQuery("sys_created_on", '>=', 'javascript:gs.minutesAgo(10)');
grAtt.query();
if (!grAtt.next()) {
alert("You must attach a vendor quote to submit this request");
return false;
}
return true;
}