<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Reset a workflow Change Request - Normal in dev instance in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717517#M374443</link>
    <description>&lt;P&gt;I want to create a UI action for the user to unsubmit their request for approval. &amp;nbsp; I dug around and found a few references but am stuck.&lt;/P&gt;&lt;P&gt;The code below seems to be working as far as removing the approvals. &amp;nbsp; The problem I'm having is that the workflow which is the default dev instance workflow named Change Request - Normal is not resetting and there's no longer an reference link to "Show workflow". &amp;nbsp; &amp;nbsp; My assumption would be that the workflow was reset and the state of the change would go back to New, currently is stays in Assess. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var comment = 'Change Owner decided to un-request approval'; &amp;nbsp; //written to the approval_history&lt;/P&gt;&lt;P&gt;if (checkResetConditions()) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // create a global variable lock on the current record&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // this will prevent triggering a second reset while the first reset is still in progress&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // lock will be release in a late running business rule called 'Workflow Release Lock'&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; chg_wf_lock = new GlideRecordLock(current);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; chg_wf_lock.setSpinWait(50); &amp;nbsp; //wait for lock&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; if (chg_wf_lock.get()) {&lt;/P&gt;&lt;P&gt; gs.print('Locking the ' + current.getDisplayValue() + ' during the workflow reset');&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Delete all of the existing approvals for the change and restart the workflow to create new approvals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // NOTE: &amp;nbsp; the code below came from &lt;STRONG style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;SNC — Approval Reset Conditions &lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;so if it's not accurate you may want to update in a future release.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // NOTE: &amp;nbsp; I also tried adding &amp;nbsp; "&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;new Workflow().restartWorkflow(current);" after the first line below as it seemed missing but that didn't work either. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new WorkflowApprovalUtils().reset(current, comment);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.addInfoMessage('Workflow has been reset. &amp;nbsp; All approvals have been deleted.');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function checkResetConditions() {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var doReset = true; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doReset = true; &amp;nbsp; //enable the reset&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; //&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; return doReset;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2016 17:53:05 GMT</pubDate>
    <dc:creator>frappe</dc:creator>
    <dc:date>2016-07-08T17:53:05Z</dc:date>
    <item>
      <title>Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717517#M374443</link>
      <description>&lt;P&gt;I want to create a UI action for the user to unsubmit their request for approval. &amp;nbsp; I dug around and found a few references but am stuck.&lt;/P&gt;&lt;P&gt;The code below seems to be working as far as removing the approvals. &amp;nbsp; The problem I'm having is that the workflow which is the default dev instance workflow named Change Request - Normal is not resetting and there's no longer an reference link to "Show workflow". &amp;nbsp; &amp;nbsp; My assumption would be that the workflow was reset and the state of the change would go back to New, currently is stays in Assess. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var comment = 'Change Owner decided to un-request approval'; &amp;nbsp; //written to the approval_history&lt;/P&gt;&lt;P&gt;if (checkResetConditions()) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // create a global variable lock on the current record&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // this will prevent triggering a second reset while the first reset is still in progress&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; // lock will be release in a late running business rule called 'Workflow Release Lock'&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; chg_wf_lock = new GlideRecordLock(current);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; chg_wf_lock.setSpinWait(50); &amp;nbsp; //wait for lock&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; if (chg_wf_lock.get()) {&lt;/P&gt;&lt;P&gt; gs.print('Locking the ' + current.getDisplayValue() + ' during the workflow reset');&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Delete all of the existing approvals for the change and restart the workflow to create new approvals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // NOTE: &amp;nbsp; the code below came from &lt;STRONG style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;SNC — Approval Reset Conditions &lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;so if it's not accurate you may want to update in a future release.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // NOTE: &amp;nbsp; I also tried adding &amp;nbsp; "&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;new Workflow().restartWorkflow(current);" after the first line below as it seemed missing but that didn't work either. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new WorkflowApprovalUtils().reset(current, comment);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.addInfoMessage('Workflow has been reset. &amp;nbsp; All approvals have been deleted.');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function checkResetConditions() {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var doReset = true; &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doReset = true; &amp;nbsp; //enable the reset&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; //&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; return doReset;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 17:53:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717517#M374443</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T17:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717518#M374444</link>
      <description>&lt;P&gt;Hi Kristin,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;There's a lot of extra (dangerous) stuff in that script you don't need to be concerned with. You should look at using :&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;new Workflow().restartWorkflow(current, false);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You'll also want to update&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.state = 1; // Adjust to your default state as needed.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Reference: &lt;A href="http://wiki.servicenow.com/index.php?title=Workflow_Script" title="http://wiki.servicenow.com/index.php?title=Workflow_Script"&gt;Workflow Script - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 17:57:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717518#M374444</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2016-07-08T17:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717519#M374445</link>
      <description>&lt;P&gt;HI Kristin,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please check 3.18 here for restart workflow&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://wiki.servicenow.com/index.php?title=Workflow_Script#restartWorkflow.28current.2C_maintainStateFlag.29" title="http://wiki.servicenow.com/index.php?title=Workflow_Script#restartWorkflow.28current.2C_maintainStateFlag.29"&gt;Workflow Script - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 17:58:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717519#M374445</guid>
      <dc:creator>Pradeep Sharma</dc:creator>
      <dc:date>2016-07-08T17:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717520#M374446</link>
      <description>&lt;P&gt;Ok, thanks. &amp;nbsp; Remember I got the dangerous stuff from the out of box SNC - Approval Reset Conditions in the out of box dev instance so if it's dangerous you might want to make it undangerous. &amp;nbsp; &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="29_264.03125_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Can you send me the suggested script? &amp;nbsp; Not sure what dangerous stuff to remove ... I'm assuming it's the lock? &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:10:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717520#M374446</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717521#M374447</link>
      <description>&lt;P&gt;Hi Kristin,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I'd go with something like this *untested* UI action script:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.comments = '&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;Change Owner decided to un-request approval';&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;current.state = 1; // update the 1 to your desired state;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;current.update();&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="co1" style="color: #006600; font-style: italic;"&gt;//mark all existing approvals for the change as 'cancelled' and restart the workflow to create new approvals&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="co1" style="color: #006600; font-style: italic;"&gt;//where current is a task record with a workflow context&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;new&lt;/SPAN&gt; WorkflowApprovalUtils&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;.&lt;SPAN class="me1" style="color: #660066;"&gt;cancelAll&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;current&lt;SPAN class="sy0" style="color: #339933;"&gt;,&lt;/SPAN&gt; comment&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;new&lt;/SPAN&gt; Workflow&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;.&lt;SPAN class="me1" style="color: #660066;"&gt;restartWorkflow&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;current&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;gs.addInfoMessage('Change request reset');&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;action.setRedirectURL(current);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;//Sorry about the funky coloring - copy/paste&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:14:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717521#M374447</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2016-07-08T18:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717522#M374448</link>
      <description>&lt;P&gt;This worked !!! And was much easier to understand, thank you very much. &amp;nbsp; &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="29_474.875_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:20:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717522#M374448</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T18:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717523#M374449</link>
      <description>&lt;P&gt;Thanks for your responses too Pradeep, much appreciated, ...are you guys in a competition? &amp;nbsp; &amp;nbsp; &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="29_593.984375_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:20:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717523#M374449</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T18:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717524#M374450</link>
      <description>&lt;P&gt;Well... It's not much of a competition when Pradeep is nearly 50,000 points ahead of me, but that gap is gradually decreasing. &lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="7.997159004211426_797.3721313476562_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/wink.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; "Proof that gamification works!" -- Dave Slusher, &lt;A title="" _jive_internal="true" href="https://www.servicenow.com/community?id=community_question&amp;amp;sys_id=f1640b69dbd8dbc01dcaf3231f9619be"&gt;TechNow Ep27&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:23:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717524#M374450</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2016-07-08T18:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717525#M374451</link>
      <description>&lt;P&gt;Friendly competition &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="8_139.46875_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:26:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717525#M374451</guid>
      <dc:creator>Pradeep Sharma</dc:creator>
      <dc:date>2016-07-08T18:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717526#M374452</link>
      <description>&lt;P&gt;PS: &amp;nbsp; I spoke a little too soon but for what it's worth this code worked if I wanted to delete all requests on the change and reset the status to New:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.comments = 'Change Owner decided to un-request approval';&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.state = -5; // set state back to New&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.update();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//Delete all existing approvals for the change and restart the workflow to create new approvals&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;new WorkflowApprovalUtils().reset(current);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;new Workflow().restartWorkflow(current);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.addInfoMessage('Change request reset');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;action.setRedirectURL(current);&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:40:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717526#M374452</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T18:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717527#M374453</link>
      <description>&lt;P&gt;Hi Kristin,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Do we need to make some changes or is that your final version of what I gave you (adapted to meet your requirements)?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:42:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717527#M374453</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2016-07-08T18:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717528#M374454</link>
      <description>&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="29_8_16_16" src="https://www.servicenow.com/8.0.1.35b65d4/images/emoticons/happy.png"&gt;&lt;/SPAN&gt; &amp;nbsp; I am not a developer these days but I'm learning fast ... so not sure&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Original line:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="kw2" style="font-family: inherit; font-style: inherit; font-weight: bold; color: #003366;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt; WorkflowApprovalUtils&lt;/SPAN&gt;&lt;SPAN class="br0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="me1" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #660066;"&gt;cancelAll&lt;/SPAN&gt;&lt;SPAN class="br0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;current&lt;/SPAN&gt;&lt;SPAN class="sy0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #339933;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt; comment&lt;/SPAN&gt;&lt;SPAN class="br0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="sy0" style="font-family: inherit; font-style: inherit; font-weight: inherit; color: #339933;"&gt;&lt;/SPAN&gt;In my version I changed cancelAll to reset to meet my requirements but that did not work either until until I also removed comment next to the word current. &lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;new WorkflowApprovalUtils().reset(current);&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN class="co1" style="font-weight: inherit; font-style: italic; font-family: inherit; color: #006600;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN class="kw2" style="font-weight: bold; font-style: inherit; font-family: inherit; color: #003366;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN class="kw2" style="font-weight: bold; font-style: inherit; font-family: inherit; color: #003366;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jul 2016 18:53:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717528#M374454</guid>
      <dc:creator>frappe</dc:creator>
      <dc:date>2016-07-08T18:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reset a workflow Change Request - Normal in dev instance</title>
      <link>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717529#M374455</link>
      <description>&lt;P&gt;Hey Chuck ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even i have the same requirement and i used the above Ui action script but it did not run .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any modifications or suggestions please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Rishi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 17:18:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/reset-a-workflow-change-request-normal-in-dev-instance/m-p/1717529#M374455</guid>
      <dc:creator>Rishi23</dc:creator>
      <dc:date>2021-01-09T17:18:39Z</dc:date>
    </item>
  </channel>
</rss>

