It is possible to create a validator script to prevent Approvals being added before its time in the process ?
We have multiple processes that do require approvals at various workflow states. However, people are getting ahead of themselves and adding in approvals before the correct process state triggering emails to the approvers when the work item is still in DRAFT
Is there a way to stop this thru a validtor script based on work item type, and state value of Draft ?
ELM702
4 answers
This can actually be done in a Javascript validator if you don't have access to the server side, but you would need to use data structures that are stable, but aren't formally externally documented.
There are actually several approaches you could take:
- prevent the work item from being saved if approvals have been created or modified and the work item is in the wrong state
- automatically create the approval and populate it when the work item gets to a specific state
Hi Karen,
We have a paid plugin for EWM that does the opposite of this -- it'll add the approval based on the transition to any state you specify.
We could modify it so that it removes approvals on certain states. You'd have to pay for the plugin, but we could do this. Here's the approval being automatically added:
https://youtu.be/qDHIdb2_LKE?t=466
So we'd allow the admin to set that if the ticket was in draft or rejected, or any other state you specify, that the approval would be deleted.
Contact info at the end of the video.