- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 04:42 AM
Hi,
Is there any way to cancel the change and approvals if scheduled starts has passed before approving the change request.
Please suggest.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:15 AM
You can create a branch activity and one branch link to approval
Another branch link to timer activity which wait till schedule start date. Once it is crossed add a run script activity and check if the change is approved or not.
If not approved, then you can use the above code and cancel the approvals and end the workflow.
Mark the comment as a correct answer and helpful if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:01 AM
Hello Karishma,
You can cancel a WF like this
var workflow = new global.Workflow();
workflow.cancel(current);
You can use the same logic of adding a wait for condition or follow the process that i suggest to you in another thread. Adding a event and add associated script action.
For cancelling approvals
var gr= new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.getValue('sys_id'));
gr.approval='cancelled';
gr.updateMultiple();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:09 AM
i want to do it using workflow.If scheduled starts passed and then i want to cancel the approvals and change and end the workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:15 AM
You can create a branch activity and one branch link to approval
Another branch link to timer activity which wait till schedule start date. Once it is crossed add a run script activity and check if the change is approved or not.
If not approved, then you can use the above code and cancel the approvals and end the workflow.
Mark the comment as a correct answer and helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:30 AM