- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 10:25 AM - edited 12-15-2023 12:38 PM
Hi All,
Could you please help me how to get list of RITM's records, which RITM has only All Closed Tasks
Conditions :
1.RITM should have at least one Task record
2.All tasks should be closed ,no single task should be open state,
3.If any Task Open State, that RITM should not consider
IF we see there RITM0010002 tasks all are closed task,
RITM0010001 has still open tasks.
Only Which RITM of all Tasks closed that RITM numbers only should Return. (result should be RITM0010002)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 07:45 PM - edited 12-15-2023 07:46 PM
It was resolved , Thanks to Ankur
https://www.servicenow.com/community/platform-analytics-forum/report-on-all-open-ritms-but-all-the-r...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 10:30 AM
Hi @Supriya25
Try this:
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 06:05 PM
IF we see there RITM0010002 tasks all are closed task,
RITM0010001 has still open tasks.
Only Which RITM of all Tasks closed that RITM numbers only should Return. (result should be RITM0010002)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 07:45 PM
Hello @Supriya25 ,
Please find below background script, you can change script according to your requirements
var gr = new GlideAggregate('sc_task');
gr.addAggregate('COUNT','request_item');
gr.groupBy('request_item');
gr.addEncodedQuery('stateIN-5,1,2'); // state is one of open, pending, work in progress
gr.query();
gs.info(gr.getRowCount());
while(gr.next()){
gs.info(gr.request_item.getDisplayValue() + "->"+gr.getAggregate('COUNT','request_item'));
}
Please mark my answer helpful & correct, it it helps you
Thank you
Thank you
G Ramana Murthy
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 07:45 PM - edited 12-15-2023 07:46 PM
It was resolved , Thanks to Ankur
https://www.servicenow.com/community/platform-analytics-forum/report-on-all-open-ritms-but-all-the-r...