in flow designer, once all the tasks are closedcomplete then RIM state should change to fulfilled

Purushotham Ga2
Tera Contributor

HI Experts,

 

in flow designer, once all the tasks are "closed completed" then RITM state should change to fulfilled. could you please assist me step by step.

3 REPLIES 3

Deepak Negi
Mega Sage
Mega Sage

This seems straightforward though, can you share your current configurations what you have tried?

 

Runjay Patel
Giga Sage

Hi @Purushotham Ga2 ,

 

seems it is duplicated,

I have answered here: https://www.servicenow.com/community/developer-forum/in-flow-designer-once-all-the-tasks-are-closedc...

 

RITM should be closed, and if you are marking other than this then you need to make ritm active false.

Accept and like the solution if it helped 

Community Alums
Not applicable

Hi @Purushotham Ga2 ,

You can achieve this in Flow Designer using a combination of "Wait for Condition" and "Update Record" actions. Here's a step-by-step guide:

1. Trigger:

  • Record Updated: This is the most suitable trigger.
  • Table: sc_task (Service Catalog Task)
  • Run the flow: for each updated record

2. Wait for Condition:

This is the core of the solution. It pauses the flow until a specific condition is met.

  • Action: Wait for Condition

  • Table: sc_task

  • Condition: This is the crucial part. You need to check if all related tasks are closed complete. Here's how you can construct the condition:

    [Request Item] = ${trigger.request_item} AND [State] != 3 AND [State] != 4
    • [Request Item] = ${trigger.request_item}: This ensures you're only checking tasks related to the same RITM as the task that triggered the flow. ${trigger.request_item} is a data pill referencing the RITM of the updated task.
    • [State] != 3 AND [State] != 4: This checks if the task state is not Closed Complete (3) and not Closed Incomplete (4). The logic is that the wait condition will continue as long as any task related to the RITM is open or in progress. Once all tasks are Closed Complete or Closed Incomplete, the condition will evaluate to false, and the flow will proceed.

3. Decision (Optional but Recommended):

It's a good practice to add a decision to explicitly check if all tasks are closed complete before updating the RITM. This adds an extra layer of validation.

  • Action: Decision

  • Condition:

    [Request Item] = ${trigger.request_item} AND [State] != 3 AND [State] != 4
    • This is the same condition as in the "Wait for Condition".
    • If the condition is false (meaning all tasks are closed), the flow will proceed to the next step (updating the RITM).
    • If the condition is true (meaning there are still open tasks), the flow will end. This prevents unnecessary RITM updates.

4. Update Record:

This action updates the RITM's state.

  • Action: Update Record
  • Record: ${trigger.request_item} (the RITM related to the triggering task)
  • Fields:
    • State: Closed Complete (3) or Fulfilled (depending on your instance configuration)

Complete Flow Structure:

  1. Trigger: Record Updated (Table: sc_task)
  2. Wait for Condition: (Table: sc_task, Condition: [Request Item] = ${trigger.request_item} AND [State] != 3 AND [State] != 4)
  3. Decision: (Condition: [Request Item] = ${trigger.request_item} AND [State] != 3 AND [State] != 4)
    • If Condition is False: (All tasks are closed) -> Proceed to step 4
    • If Condition is True: (There are still open tasks) -> End Flow
  4. Update Record: (Record: ${trigger.request_item}, Fields: State = Closed Complete)

Explanation:

The "Wait for Condition" is the key. It keeps the flow waiting until the specified condition is no longer met. Once all related tasks are closed (either complete or incomplete), the condition becomes false, and the flow continues to update the RITM. The decision adds an extra check to make absolutely sure all tasks are closed before updating the RITM.