After Rejected, Change Request State should be be 'Closed' not 'New'

Servicenow10
Kilo Guru

My requirement is that if at any approver rejects the Change Request, the state should become 'Closed' instead of 'New'. I tried it using workflow but not able to achieved.............

if an approver rejects the change request it should be closed with a comment because of approvers rejection it is closed 

1 ACCEPTED SOLUTION

Hi,

Here is how you can do this. I checked in my PDI and its working fine.

After reject notification, in your WF, add run script activity.

In run script, add the following code.

current.setWorkflow(false); //This will disable the BR that is restring the state move.
current.close_notes = "rejected";
current.close_code = "unsuccessful";
current.state = 3;

Connect Reject notification -> Run script -> End.

Mark the comment as a correct answer and also helpful once worked.

View solution in original post

21 REPLIES 21

hi asifnoor,

 

as this is organizational stuff so i cannot share details however i can share the screen shots....from which you can modify it

 

thanks 

Okay.. kindly share the following information.

Create a new CR.

open the CR and click on show workflow link. Then share the screenshot of that. this will tell us which WFs are running on that CR.

That share me the WF screenshot of the CR.

hi asifnoor,

 

thanks for your help ....i will share step by step about requirements:

 

so when you create a new change request it shows refer below screenshot

find_real_file.png

 

so when you request for approval it goes to state assess and if approver reject the change request it makes the state new 

 

find_real_file.png

 

workflow screenshot:

find_real_file.png

 

now my requirement is that if approver reject the change request it should goto closed state with 

close code : unsuccessful

close notes: as change request go rejected this is getting closed incomplete

if anything else required please tell me....

 

thanks in advance

The description of your 'set value' activity says "Set state to New and approval to rejected". What values are you actually setting in this activity?

hi moy

 

if you this through wf it wont work