How to get list of RITM which doesn't have any associated Ctasks.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 05:26 AM
Hello Folks,
I am trying to get list of RITMs which are opened 90 days ago, active true, approval is not waiting for approval and those RITMs doesn't have any Ctask associated with them.
(function() {
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addEncodedQuery('stage!=waiting_for_approval^active=true^opened_atRELATIVELT@dayofweek@ago@90');
ritmGr.query();
while (ritmGr.next()) {
var Ctask = new GlideRecord('sc_task');
Ctask.addQuery('request_item', ritmGr.sys_id);
Ctask.query();
while(Ctask.next())
gs.info('Ctask Number: ' + Ctask.number);
}
})();
but this will give me list of Ctask which are created against RITM but i need list of RITMs which doesn't have any Ctask associated with them.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 07:20 AM
instead of setLimit, use chooseWindow function.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 06:39 AM
Hi @Vijay Baokar ,
Check this out ! its simple with a report
IMPORTANT : select no in the realted list conditons
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....