- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2019 11:46 PM
Hi all,
I have this UI action button where it should close the current sctask and ritm and it should cancel the workflow so that it does not spawn the follow up sctask (as there is one in the workflow). The closure of current sctask and ritm is working however, the following sctask/workflow is not cancelling:
UI action table: sc_task
script:
function cancelTask(){
if(confirm('Are you sure you want to close complete this request?')){
gsftSubmit(null, g_form.getFormElement(), 'cancel_sc_task');
return true;
}
return false;
}
// Server side code
if(typeof window == 'undefined')
updateTaskAndRITM();
function updateTaskAndRITM(){
new Workflow().deleteWorkflow(current);
current.active=false;
current.state=3;
current.update();
action.setRedirectURL(current);
var reqItem = new GlideRecord('sc_req_item');
new Workflow().deleteWorkflow(current);
reqItem.get(current.request_item);
reqItem.state = 3; //value for Closed complete
reqItem.stage = 'Completed';
reqItem.update();
new UIActionUtils().approvalsNoLongerRequired(current.sys_id);
}
This circled sctask still spawns that should not have spawned:
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2019 06:41 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2019 06:41 PM