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,

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.

Hi,

Could you also mark this comment as a correct answer and helpful so that the question is moved to the solved list.