WF send back to requestor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 12:18 PM
Hello, running into a issue where im having trouble resetting the values in the workflow.
for example, once the RITM is deep in the WF i send it back and goes back to the user it then goes back in the workflow and starts from the begining, right now im having trouble resetting/changing the values within those tasks "approval" "state" those values are staying approved however i want those to reset back to either pending or rejected. ive tried to use the "Set Values" within the WF but i have had zero luck so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2022 12:21 PM - edited 10-21-2022 12:23 PM
Maybe you can mimic what's in the "Change Request - Normal" workflow. There's a run script to disassociate approval records
var existingApprovalsGr = new GlideMultipleUpdate("sysapproval_approver");
existingApprovalsGr.addQuery("sysapproval", current.getUniqueValue());
existingApprovalsGr.addQuery("state", "!=", "cancelled");
existingApprovalsGr.setValue("wf_activity", "");
existingApprovalsGr.execute();
existingApprovalsGr = new GlideMultipleUpdate("sysapproval_group");
existingApprovalsGr.addQuery("parent", current.getUniqueValue());
existingApprovalsGr.addQuery("approval", "!=", "cancelled");
existingApprovalsGr.setValue("wf_activity", "");
existingApprovalsGr.execute();