Run a scrit to reject aprovals

manoharpatki
Tera Contributor

1. Set approval status to Rejected
2. Set RITM state to Closed Incomplete
3. Run the script / flow on every Monday 7 AM CST.
4. Rejection Comment: "canceled"

 

I tried to implement this through scheduled job but it failed. Can anyone please help on this.

2 REPLIES 2

Hemanth M1
Giga Sage
Giga Sage

Hi @manoharpatki ,

 

This can be easily done using scheduled flow (no code), create a flow as below 

 

One quick question : Are you rejecting all the inflight approvals without any specific condition and why??

 

however you can achieve this as below

1)Run every monday at 7 AM

2)Look for RITM which is waiting for approval (have your additional condition to fetch specific record)

3)look for each approval records which are in state is in requested (if multiple approvals)

4)set the approvals to reject state and add the comment

5)Set the RITM to closed incomplete state and set the stage as request cancled.

 

HemanthM1_0-1698505118320.png

 

Result:

RITM:

HemanthM1_1-1698505412562.png

 

Approval Record:

HemanthM1_2-1698505462822.png

 

 

Hope this helps.

 

 

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Hi @manoharpatki ,

 

Accept the response if this helped you (so that others can refer )or ask if any follow up questions.

 

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025