How to re-start workflow (change request) after approval rejection

rhofing
Tera Contributor

We have a change workflow that starts with a Change in Draft state.   When the user is ready they submit it to be validated (state = To be Validated). The validator then moves the change to Requested state which sends notification to the approvers.   It can then be approved or rejected.   If approved it moves on until the end. This is working fine.

However, if it is rejected a notification is sent to the requester (this works fine), but I want to reset the state to Draft (so the requester can re-work the Change and then re-submit to validation), which I did with a script, and then re-start the work flow.   This is not working.   I tried using rollback back the workflow kicks in immediately and places the change in the To Validate state. Essentially what I want to do is start completely over with the existing change request.

Thank you!

Ric

6 REPLIES 6

jancaasi
Mega Expert

Hi Ric,



I would definitely go with Chandra Miller's suggestion. As far as I know, the Rollback to resets activities back to their original state.



For your reference:



Designing Workflows with Rollback To - ServiceNow Wiki


rhofing
Tera Contributor

I found my solution: I created an after update business rule with a condition that approval changes and changes to rejected. The code in the business rule then cancels the workflow:



var workflow = new Workflow();


workflow.cancel(current);



This works perfectly.   The user can then make any needed changes (based on the approvers comments in the rejection email) and then re-submit the change.