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,

In your workflow, after you send the rejected notification, you are linking back to new, bcoz of which the state is showing new.

Instead create a new activity Set values, and in that, set close code to unsuccessful and from Rejected notification -> link to set values -> end. 

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

yes i want this only however how can i achieve this and if a make a copy of change request normal wf and modify it then how i change it

Okay.

Is there a way to differentiate your change requests from other CRs? 

If yes, then make a copy of the workflow and in that you make this changes.

Then in your OOB WF, add a condition (under WF -> properties) something like (based on your condition)

Ex: assignment group is NOT your group

and in your WF, add a condition, saying

assignment group is your group.

This way, when your CR is created, your WF will be running and for other CRs OOB WF will run.

Mark the comment as a correct answer and also helpful if this helps.

can you explain this step in detail

If you are from India, could you call me on my number 9885189192. It is easier to explain.