- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 07:06 AM
Hello,
I got an issue with some RITMs which remain in state open/in progress even when all sctasks were already completed long time ago. I need to get the list of such RITMs.
I found a great solution in postSolved: Report on all Open RITMS but all the related sctas... - ServiceNow Community , thank you @Ankur Bawiskar. However after migration to Xanadu, my report is empty.
I have created identiacal script include as client callable.
Condition of Report
sys_id [IS ONE OF] javascript: new RRRRRRR().getRITM();
When I checked client callable, i was asked for role, so i used itil role.
@Ankur Bawiskar do you have any idea what could be changed in Xanadu or what i did wrong? Before migration it worked perfectly.
Thank you so much in advance,
Best regards,
Fotina
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:36 PM
Conditions on related records are sometimes a little harder to express.
Also, you need to express how many you expect. You're saying "GREATER THAN OR EQUAL TO 1" before your conditions.
The conditions you SHOULD Have are more like "NONE", where sc_task.active = true.
AKA: "Count all the active tasks, and if that count is 0, then I've passed the conditions, therefore show me the RITM".
WARNING!! This will be true for any RITM that is *also* waiting for approval before sc_tasks generate, so you may want to add a condition to your main RITM conditions like "stage != Approval"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:59 PM
Where is says "Greater than or Equal to 1" change that to None.
Additionally change your conditions to use the open states instead of the closed states, and active=true.
This way the report will look for any RITMs where there are no SCTASK records that are still open.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:36 PM
Thank you so-so much @BriTaylor! It looks exactly as you said!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:36 PM
Conditions on related records are sometimes a little harder to express.
Also, you need to express how many you expect. You're saying "GREATER THAN OR EQUAL TO 1" before your conditions.
The conditions you SHOULD Have are more like "NONE", where sc_task.active = true.
AKA: "Count all the active tasks, and if that count is 0, then I've passed the conditions, therefore show me the RITM".
WARNING!! This will be true for any RITM that is *also* waiting for approval before sc_tasks generate, so you may want to add a condition to your main RITM conditions like "stage != Approval"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:39 PM
Hi @Uncle Rob Thank you so-so much for warning, thats right, I didnt think about it, very important remark!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 08:28 AM
I agree with Rob here.
You can try to leverage related list conditions here
But for the script did you debug if it is getting called?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader