How to configure 'Stage' as 'Request Cancelled' and 'State' as cancelled using Flow Designer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 07:50 AM
Hi...We have a requirement to configure a Flow Designer to set 'Stage' as 'Request Cancelled' and 'State' as 'Cancelled' for a RITM in ServiceNow, whenever an Approver Rejects the approval for RITM. We have configured our flow with Update request item action and setting Stage and State fields with these values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 08:01 AM
Did you use "update record" activity? in update record activity , you can select record as RITM from right panel and set the state to "Cancelled".
AND
You can use 'stages' to manage the current stage. If you however on the line between actions (so before your requested item) you will see an option appear to add a stage.
You can manage stages from the options of your Flow, to use existing ones or create new ones.
Can be a bit clunky, but just however your mouse over the line break (where you see the grey line) and an add stage button appears where you can control stage behaviour
🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2024 01:46 AM
We have a requirement to configure a Flow Designer to set 'Stage' as 'Request Cancelled' and 'State' as 'Cancelled' for a RITM in Servicenow, whenever an Approver Rejects the approval for RITM. We have configured our flow with Update request item action and setting Stage and State fields with these values. However , while testing Rejection Approval , we found that it is setting Stage correctly to "Request Cancelled", but setting State to random value e.g. On Hold, Pending etc.
Could anyone help us how do we set the state to "Cancelled" value upon Approval Rejection?
NOTE: We want it to set automatically via Flow designer and not via any 'Cancel' button on form. It is not showing 'Cancel' option in current RITM state field. May be this is the reason Flow is also not getting the Cancel value. How can we display Cancel value under State drop down for our RITM? (We already have State value defined in ServiceNow , but still is does not show under State drop down). Please find screenshots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 08:08 AM
Hi @priyanka0709 ,
You can set the RITM stage by using Flow stages and once the stage is set based on that we can set the RITM state and request state to closed incomplete through Business rule,
(function executeRule(current, previous /*null when async*/) {
var reqUpdate = new GlideRecord('sc_request');
reqUpdate.addQuery('sys_id',current.request);
reqUpdate.query();
if(reqUpdate.next()){
reqUpdate.state = 4 ;
reqUpdate.request_state = 'closed_cancelled';
reqUpdate.update();
}
})(current, previous);
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 08:19 AM
Hi @priyanka0709 ,
Please check if below screenshot helps you. It is updating 'Requested Item' table 'State' and 'Stage' when approval gets rejected.
Thanks
Himani