How Can I set REQ & RITM State to Closed Incomplete After Request Cancelled Stage in FLOW Designer?

WazzaJC
Tera Expert

How Can I set REQ & RITM State to Closed Incomplete After Request Cancelled Stage in FLOW Designer?

 

Hi ServiceNow Community experts,

 

I would greatly appreciate any help/advice on how to achieve this.

 

I want to set the Request and RITM 'State' to 'Closed Incomplete' after the Stage ' Request Cancelled', when using Stages in Flow Designer.

 

At the moment, when using Request Cancelled Stage in the Flow, the flow gets cancelled (as expected) but REQ and RITM State are set to 'Closed Complete'.

 

How can I set these stages back to Closed Incomplete and still allow the 'Request Cancelled' Stage to be used within the FLOW?

 

I would really appreciate help on this - I would prefer to do this all within Flow Designer, without having to write separate Business Rules outside of the Flow, but not sure if this is possible?

 

Many thanks for any advice on how to achieve.

2 ACCEPTED SOLUTIONS

No, he hasn't. Never try to use those AI generated answers, because they simply don't help. They take a part of what you are asking and make a lot of assumptions. It's just trying to get as many helpfuls as possible, without the person posting them even knowing what they are doing. This is the worst development on the community recently.

But I guess some other functionality is in place, taking care of your records. You need to check business rules, flows and workflows that are active on Request and Requested Item. You will need to inactivate the current logic of setting it to 'complete' so your own logic to set 'incomplete' will work.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

Hello,

 

When an approver rejects a Requested Item (RITM) in ServiceNow, two out-of-the-box business rules work together to automatically set the state to "Closed Incomplete":

  1. Reject Approval on Closed Incomplete - This business rule triggers when an approval is rejected, it checks for the related RITM tasks, if no tasks found, automatically changing the RITM's state to "Closed Incomplete" 
  2. Close Parent if Required - This business rule ensures proper state propagation throughout the request hierarchy. When child tasks are closed (due to rejection), this rule evaluates if the parent RITM should also be closed, maintaining consistency in the request fulfillment process.

View solution in original post

11 REPLIES 11

swathisarang98
Giga Sage
Giga Sage

Hi @WazzaJC ,

 

I have tried this use case in my pdi and ootb box when stage is "Request Cancelled" state of RITM is setting to "Closed Incomplete " but still in your case if its not working and if you dont want to use BR then only for your flow based on the conditions  you can add Action like "Update Record" and in that you can set "Record" as "Requested item record" (bring it from data pill ) and set the filed state. 

 

swathisarang98_0-1708339344310.png

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,

Swathi Sarang

 

 

 

 

Hi @swathisarang98 . I do have that set up already (as per yours). However, if you add a Stage called 'Request Cancelled' to that Flow, give that a try and it will result in a Closed Complete, not a Closed Incomplete. So if you take your exact configuration above, but place/insert a Flow 'Stage' above that line, called 'Request Cancelled', when you try that out, you should see that Closed Complete is set for the REQ and RITM and it ignores that you have asked for 'Closed Incomplete' to be the State. Give it a try and let me know ? Many thanks.

Rajdeep Ganguly
Mega Guru


To set the Request (REQ) and Requested Item (RITM) 'State' to 'Closed Incomplete' after the 'Request Cancelled' stage in Flow Designer, you can follow these steps:

1. Open the Flow Designer in ServiceNow.
2. Select the flow where you want to implement this change.
3. Add a new action after the 'Request Cancelled' stage.
4. In the new action, select 'Update Record' from the list of available actions.
5. In the 'Update Record' action, select the table 'Requested Item [sc_req_item]' and set the 'State' field to 'Closed Incomplete'.
6. Repeat the same steps for the 'Request [sc_request]' table.
7. Save and test your flow.

Please note that the 'Closed Incomplete' state might not be available by default. You might need to add it to the 'State' field choices for the 'Requested Item [sc_req_item]' and 'Request [sc_request]' tables.

Here is a sample code for the 'Update Record' action:

javascript
(function execute(inputs, outputs) {
var gr = new GlideRecord('sc_req_item');
gr.get(inputs.sys_id);
gr.state = 'Closed Incomplete';
gr.update();
})(inputs, outputs);


Please replace 'sc_req_item' with 'sc_request' for the Request table.

Remember, this is a high-level overview and might need adjustments based on your specific ServiceNow setup and requirements.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER

Hi @Rajdeep Ganguly  this approach still does not work. Please see my screenshots attached.

I have done your suggested configuration after the Request Cancelled Stage, but it still sets the Req and RITM State to Closed Complete. Have you tried this suggested Config on your side to see if it works? Thanks.

No, he hasn't. Never try to use those AI generated answers, because they simply don't help. They take a part of what you are asking and make a lot of assumptions. It's just trying to get as many helpfuls as possible, without the person posting them even knowing what they are doing. This is the worst development on the community recently.

But I guess some other functionality is in place, taking care of your records. You need to check business rules, flows and workflows that are active on Request and Requested Item. You will need to inactivate the current logic of setting it to 'complete' so your own logic to set 'incomplete' will work.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark