SC task rejected but RITM state shows as Closed Complete

GBS
Tera Contributor

Hi, 

 

 I have created a flow and if the Cost centre manager rejects the approval then the RITM state should be closed incomplete but even if the approval got rejected the RITM state shows as Closed complete.

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @GBS 

I checked the OOTB and it is seems an expected behaviour.

AGLearnNGrow_0-1708965392886.png

 

*************************************************************************************************************
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]

****************************************************************************************************************

swathisarang98
Giga Sage
Giga Sage

Hi @GBS ,

 

You can Try after update BR

Table: sc_req_item

condition as shown below,

Note: better to keep your catalog item in condition so that it will not run for others,

swathisarang98_0-1708981446686.png

 

 In action, to update requested item state

swathisarang98_1-1708981446685.png

 

In advanced, to update Request table

swathisarang98_2-1708981446724.png

 

code

(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

Sumanth16
Kilo Patron

Hi @GBS ,

 

This is known issue in ServiceNow. ServiceNow provided the solution to fix this issue.

 

Please refer to below article:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0827184

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda