Comments on: Reset change request workflow, approvals, and tasks https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/ ServiceNow Consulting Scripting Administration Development Thu, 16 May 2024 13:13:46 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Chenelle Tucker https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5958 Tue, 15 Apr 2014 20:45:18 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5958 Hi everyone,

I have a different issue here. I have a workflow with process approvals and also out of the box approvals, or shall I say manual group approvals to be added. However when we add a group to the group approval tab and set it to “wait for: Anyone to approve” when we go in and test it by approving on of the users in the approvers tab, its approved, but the other members in the group does not change to “No longer required” We have a business rule on it but it isnt working, Anyone ran into this using the changemangement process in the Calgary release? We have workflow group approvals and the “Wait for anyone to approve” works, but not for the manual group approvals. Please advise if anyone can. Thanks!

]]>
By: Mark Stanger https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5957 Thu, 27 Feb 2014 14:10:13 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5957 In reply to Monette.

There’s a lot of code here, but the only part that is relevant to what you are struggling with is the ServiceNow-provided code in these two lines…

new WorkflowApprovalUtils().cancelAll(current, comment);
new Workflow().restartWorkflow(current);

I would try to reduce the business rule down to those two lines and see what happens. If that doesn’t solve the issue, then I would try it in a ServiceNow demo instance to see. I’m guessing you’ve got some other business rule or workflow activity/script interfering with this script.

]]>
By: Monette https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5956 Thu, 27 Feb 2014 01:34:06 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5956 In reply to Mark Stanger.

Hi Mark,

I find that the approvals are being reset, but the tasks are not reset. When the approvals are approved, nothing changes in the tasks. I tried to mark one task as ‘Closed Complete’, but it didn’t trigger the workflow. When I checked the workflow status using “show workflow”, I saw that it considered it to have run having the result of ‘1’. The state or result before the workflow got cancelled.

I tried to cancel the workflow first before restarting, but it still is not working. Here’s an excerpt of my code:
new Workflow().cancel(current);
new WorkflowApprovalUtils().reset(current, comment);
new Workflow().restartWorkflow(current, false);

Do you know what I could change?

Many thanks,
Monette

]]>
By: Monette https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5955 Thu, 27 Feb 2014 01:28:04 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5955 In reply to Joe S.

Hi Joe,

We are running Calgary also and find that only approvals are reset but not the tasks. May I know which business rules and other script includes you found to not be in calgary, please?

Cheers,
Monette

]]>
By: Joe S https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5954 Wed, 23 Oct 2013 16:22:15 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5954 In reply to Joe S.

Hi Mark,

We’ve figured out our issue just not sure why it happened. The business rule didn’t exist on our instances running Calgary. We found the wiki article detailing the business rule and the API call changes in Calgary. We copied the business rule from our QA instance that wasn’t running calgary made the changes to the package call and all is working now. Just not quite sure why the business rule would have been deleted or not copied in the upgrade process.

]]>
By: Joe S https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5953 Wed, 23 Oct 2013 15:11:13 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5953 Hi Mark,

We’re having an issue getting this functionality to work in Calgary. When clicking the button now the action will reset the approval to reset but nothing is happening to the approval tasks, change tasks, and the actual workflow. Has anyone else been having a problem with this function in Calgary?

]]>
By: Amruta https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5952 Mon, 27 May 2013 13:21:30 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5952 Hi Mark

This solution works if all approvals have to be reset and workflow has to be restarted. However, if there is a requirement that workflow should be reset to a specific task state and approvals after that task state should only be reset – how can this be handled? If the condition on which this reset should happen could have been easy, we could have used rollback activitiy or goto activity in workflow editor. I do not see any script functions for rollback on wiki. Any ideas?

]]>
By: Mark Stanger https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5951 Thu, 17 Jan 2013 13:34:34 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5951 In reply to Antonio G.

Thanks for the heads up! I’ve fixed the link in my response to Michael.

]]>
By: Antonio G https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5950 Thu, 17 Jan 2013 13:24:46 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5950 In reply to Mark Stanger.

Mark, your link appears to be broken. My problem is similar to Michael’s and it seems like this would be helpful!

]]>
By: David Martin https://servicenowguru.com/business-rules-scripting/reset-change-request-workflow-approvals-tasks/#comment-5949 Wed, 14 Dec 2011 15:53:52 +0000 https://servicenowguru.wpengine.com/?p=381#comment-5949 Thanks Mark, I have multiple points of when the workflow could be reset, so was hoping to have just 1. Thinking about it, in this situation it may be better to use the rollback functionality.

Cheers
Dave

]]>