- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 03:28 AM
Hello,
I have a question, how can I create a report (or list it via script) with all open RITMs (State == Open) but where all fulfillment tasks are closed? In other words when there is for example a request which has 5 tasks and all of them are closed but state of the request is Open, then I need that to show in my report.
Aby help much appreciated!
Solved! Go to Solution.
- Labels:
-
Analytics and Reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 04:21 AM
Hello
you can try this below script .
I tried this in Background script with the same scenario and it worked
var arr=[];
var gr= new GlideRecord('sc_req_item');
gr.addQuery('state',1);
gr.query();
while(gr.next())
{
var ct = new GlideRecord('sc_task');
ct.addQuery('parent',gr.sys_id);
ct.query();
while(ct.next())
{
if(ct.state==3||ct.state=="3")
{
if(arr.indexOf(gr.number.toString())==-1)
{
arr.push(gr.number.toString());
}
}
}
}
gs.print(arr);
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 04:35 AM
Hi,
this link has solution
How to create a report on Active ( open) RITM's where all its tasks are closed
sharing few other links for help
Report on all Open RITMS but all the related sctasks are closed
Need to Build a report on Open RITM when all the associated tasks are closed
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 04:56 AM
That could work, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 05:00 AM
Did you accidentally marked other response as correct?
Your original question was regarding reports and not related to any background/other script.
The 1st link I shared has solution without script.
Would you mind marking appropriate response as correct so that it helps future members.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 05:15 AM
Hello,
hope you are doing good !
in the question posted it was written as below
I have a question, how can I create a report (or list it via script)
Good Day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 05:18 AM
Hi,
Thanks for asking. I am doing good. Hope you are good and safe !!
I believe the question was about report and I believe it can be achieved without scripting.
Even if script is used it won't work directly. The script should be invoked as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader