How to set RITM to Closed Skipped and Request to Closed Rejected when Approval is rejected

mallikabhupathi
Tera Expert

All,

 

I have a requirement to set the RITM to Closed Skipped and Request to Closed Rejected when  the Approval is rejected.

Pasting a screenshot for reference.

 

mallikabhupathi_0-1686770804208.png

 

 

Any help will be appreciated! 

 

Thanks,

Mallika

4 REPLIES 4

Hemanth M1
Giga Sage
Giga Sage

Hi @mallikabhupathi ,

 

1)You can add a set value to update RITM to "Closed Skipped"

2)Add run script to update Request to "Closed Rejection" as below

 

Another approach :or if you can write a BR/Flow to update these if you don't to do it in the workflow.

 

HemanthM1_0-1686791852474.pngAcc

HemanthM1_1-1686791890701.png

Accept the solution if this helps.

 

Thank you,

Hemanth

Accept and hit Helpful if it helps.

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

Hi @Hemanth M1 ,

 

I tried your way but the state is reflecting Closed Complete on both the RITM and Request.

 

Amit Gujarathi
Giga Sage
Giga Sage

HI @mallikabhupathi ,
I trust you are doing great.

  1. Open the workflow for the approval process in ServiceNow.
  2. Identify the activity or step in the workflow where the approval rejection occurs. Let's assume it's called "Approval Rejection Activity."
  3. In the "Approval Rejection Activity," add a new script action to perform the necessary updates on the RITM and Request records. Below is an example of the code you can use:
// Get the current RITM record
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.request_item.sys_id);
ritm.query();
if (ritm.next()) {
  // Set RITM state to Closed Skipped
  ritm.setValue('state', 8); // 8 represents the "Closed Skipped" state in ServiceNow
  
  // Update the RITM record
  ritm.update();
}

// Get the current Request record
var request = new GlideRecord('sc_request');
request.addQuery('sys_id', current.request_item.request.sys_id);
request.query();
if (request.next()) {
  // Set Request state to Closed Rejected
  request.setValue('state', 7); // 7 represents the "Closed Rejected" state in ServiceNow
  
  // Update the Request record
  request.update();
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi @Amit Gujarathi ,

 

I tried using this script but the RITM and Request states are showing Closed Complete.

I also tried to replace the 'sys_id' with the actual sys id of the catalog item and it is not reflecting the state.

 

mallikabhupathi_0-1686854047144.png