RITM closure only when all SCTASK (Automated/Manual) are closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 09:40 PM - edited 05-02-2023 09:46 PM
Hello Experts,
I have a client requirement to allow users to create manual catalog task on a RITM record (post approval) in addition to the auto-generated catalog task.
The automated task creation on RITM is driven by a subflow (attached for reference) which is associated to the item flow.
I am able to add a manual catalog task to the RITM's Catalog Task related list and have also defined Lookup Records and For Each Item actions on the task creation subflow to validate for every associated task if closed.
The issue I am facing is, if I close the auto-generated SCTASK prior to closing the manual task(s), the flow does return the associated task(s) from the Look Up Records action but is skipping the For Each Item action validation, and closing the RITM even if any task is open
It would be a great help if any on correct me with the flow.
Regards,
Somujit
- Labels:
-
Request Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 10:05 PM
Hi @Somujit1 ,
I trust you are doing fine.
you're facing an issue where the For Each Item action validation is being skipped if you close the auto-generated SCTASK prior to closing the manual task(s), and the flow is closing the RITM even if any task is open.
To address this issue, I recommend modifying your subflow to include a check that ensures all associated tasks are closed before allowing the RITM to be closed. One way to do this is to add a decision point in the flow after the Lookup Records action that checks if there are any associated open tasks. If there are, the flow should return to the For Each Item action validation until all tasks are closed. If there are no open tasks, the flow can proceed to close the RITM.
Here's some code that can help implement this modification:
// Add a decision point after the Lookup Records action to check for open tasks
if (current.variables.ritm_catalog_task.state == 'closed_complete') {
// All associated tasks are closed, proceed to close the RITM
current.variables.ritm_state = 'closed_complete';
} else {
// There are still open tasks, return to the For Each Item action validation
gs.addInfoMessage("Please close all associated tasks before closing the RITM");
current.variables.ritm_state = 'awaiting_catalog_task';
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 10:42 PM
Hi @Amit Gujarathi ,
Thanks for your reply.
I dont have any variables on RITM to capture the state. Didn't exactly understand what you are suggesting here to do.
As I am aware the Make a Decision flow logic is to perform some action on a record based on some predefined decision, but here i want the flow to validate all the RITM associated lookup SCTASK records if completed prior to RITM Closure.
The RITM closure in our scenario is being driven by the flow and not a manual update on RITM record
Regards,
Somujit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2025 08:11 PM
@Somujit1did you ever find a solution for this? I have the same issue also with a flow that I have.
Thanks!