- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 01:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 01:19 AM
Hi @vardhan3 ,
Could you please elaborate your requirement ?
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 01:19 AM
Hi @vardhan3 ,
Could you please elaborate your requirement ?
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 02:42 AM
write a script to pick RITM which are in open state once after the closure of child tasks(catalog tasks and approval tasks)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 03:36 AM
Hi @vardhan3 ,
Please find the below code,
var arr = [];
var gr = new GlideRecord('sc_task');
gr.addEncodedQuery('stateIN3,4,7');
gr.query();
while(gr.next()){
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', gr.request_item.toString());
ritm.addQuery('active',true);
ritm.query();
while(ritm.next()){
arr.push(ritm.number.toString() + "\n");
}
}
gs.print("RITM number: " + arr );
run this in background script
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2024 04:15 AM
Hi Swathi
Thank you for script but when I checked the output in background script there is one RITM whose sc task is still open and when I checked one scenario like create another sc task under existing closed sc task then that RITM also coming in final result . Kindly check and confirm.
Please check the attached screenshot.
our requirement : To pick up RITM which are in open state once after the closure of child tasks