- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2018 10:03 AM
On a catalog item we have a single user approval before the catalog tasks begin. To save some time and effort we're implementing a consent through silence approach after 3 business days, where if the approver takes no action the item is auto-approved. We've successfully setup the auto-approval with a timer, if statement, and Set Value, but I'm having trouble with what happens if the approver manually takes action on the request. To make sure the Approval - User task accepts the auto-approval update we have the wait for set to this condition based script:
if(current.approval == 'approved'){
answer = 'approved';
}
Unfortunately this seems to render any manual user approve or rejects useless. Is there scripting we can add to the above or do we need to have two separate Approval - User tasks, the second using the standard "anyone approves" option? Or perhaps is there something we can do to cancel the timer if a manual approve/reject is done?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2018 07:57 AM
For those interested, here's what our solution turned out to be:
Both the manual approval task and the timer begin at the same time. If the manual approval is approved/rejected, the request moves forward and the timer eventually runs out. The key was to add an approval action after the timer: if the manual approval had not been completed the workflow would disregard the pending approval, thus marking it as completed. The manual task would then change to "No longer required" and the workflow progressed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 08:06 AM
Hi Keri,
The wait for condition will be separate activity based on script and no relation with Approval - User task activity.
Branch will go to 2 activities: 1 will be timer based on days and another will be wait for condition based on script
for both the activities their output transition should go to further activity of creating catalog task
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 08:30 AM
The problem is this doesn't address the Approval - User task. If the approval task is left to approve when anyone approves and the timer completes and approves the request, the Approval task is left open. This causes problems later in the workflow (we have a Join later on) because there is still an open task. This is why we have the condition based script on the approval task.
The problem with the condition based task is that it seems to render the manual approve/reject actions taken on the task useless. The approver can go in and select approved and the approval task state is updated but the workflow does not progress. The approval task, though approved, stays in a Running state until the Timer completes.
The Wait for Condition doesn't seem to help either of these issues.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2018 08:39 AM
You can create a scheduled job and query the sysapproval_approver and add the necessary condition to query the record that was not updated more than three days, instead of using the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2018 07:57 AM
For those interested, here's what our solution turned out to be:
Both the manual approval task and the timer begin at the same time. If the manual approval is approved/rejected, the request moves forward and the timer eventually runs out. The key was to add an approval action after the timer: if the manual approval had not been completed the workflow would disregard the pending approval, thus marking it as completed. The manual task would then change to "No longer required" and the workflow progressed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2020 03:48 AM
May I know what have you passed in the 'if' condition here?
Thanks in advance,
Juilee