// Execute the client side code function confirmClosure() { if (confirm('Are you sure you want to close this issue?') == false) { return false; } else { // Submit the server side code below gsftSubmit(null, g_form.getFormElement(), 'vf_close_complete'); } } // Ensure call to server-side function with no browser errors if (typeof window == 'undefined') { // Server side code updateCloseComplete(); } // Server side code function updateCloseComplete() { var taskList = new IssueGrouping().hasOpenTasks(current); if (taskList.length > 0) { var link = '<a id="permalink" class="linked" style="color:#666666;" href="/sn_grc_task_list.do?sysparm_query=sys_idIN' + taskList.toString() + '" target="_blank">Active Remediation Tasks</a>'; gs.addErrorMessage(gs.getMessage('This Issue has open Tasks and/or Actions and the state of the Issue cannot be set to Closed Complete whilst open child Tasks or Actions exists Please close the child Tasks and/or Actions first. Click here for a complete list of open child Tasks and/or Actions: {0}', link)); } else { current.state = '3'; current.substate = ''; current.update(); action.setRedirectURL(current); } }