Req state update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 04:50 AM
I'm using the below script to update the Request state and RITM stage based on the RITM state. It is working fine for individual RITMs but not for order guide. Can anyone help me on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 04:53 AM
Hi @GBS
How will the system update the status, considering there are many RITMs under a single order guide, all linked to one REQ? For example, out of 10 RITMs, 2 are in fulfillment, 2 are completely closed, and the remaining 6 are awaiting approval. How will the system determine the exact status of the REQ in this case?
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
02-17-2025 04:58 AM
Hi,
Thank you for sharing your script it helped me to understand! Based on your description, it seems like the issue occurs specifically when handling Order Guides, where multiple RITMs (Requested Items) are created under the same Request (REQ).
I have checked your script and your script checks if the COUNT of active RITMs is 0, but, Order Guides create multiple RITMs under a single REQ - this means the script might not be updating the Request state correctly when all RITMs are completed. In other words, your script only processes the current RITM but does not verify if all RITMs under the same Request have been closed before updating the Request state.
Hope it was somehow helpful,
Also if you need any scripting help - please feel free to text here or me directly I can help you,
Best regards,
Renat Akhmedov