Skip to main content

Kill a workflow wait block

this can be accomplished by a UI action (button) on the wf_executing table

this can either be
server side code:

var url= /sys_trigger_list.do?sysparm_query=nameLIKE' + current.sys_id + '&sysparm_list_mode=grid';
action.setRedirectURL (url);


or client side code:
tick the client box
in the onclick box, enter: go_to_trigger();
in the script box enter:

function go_to_trigger(){
    var grT=new GlideRecord('sys_trigger');
     grT.addQuery('nameLIKE' + g_form.getUniqueValue() );
     grT.query();
     if (grT.next()){
          var url=new GlideURL('/sys_trigger.do');
          alert('redirecting to sys_trigger entry');
            url.addParam('sys_id', grT.sys_id);
           g_navigation.open(url.getURL(), '_blank');
      }

}

note: you may need to enable popups in the browser for the client option

simply navigate to the sys_trigger, and update the 'next action' date field to 30 seconds from now, and job done! watch the workflow free itself up

Comments

Popular posts from this blog

Get URL Parameter - server side script (portal or classic UI)

Classic UI : var sURL_editparam = gs . action . getGlideURI (). getMap (). get ( ' sysparm_aparameter ' ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); } Portal : var sURL_editparam = $sp . getParameter ( " sysparm_aparameter " ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); }

ServiceNow - script include: build up the results as a JSON object (array) - example 2

function call var sCurrentGroupMembers = new <script_include> (). getGroupMembers ( group_sysid ); gs . print ( 'sCurrentGroupMembers:' + sCurrentGroupMembers ); var oGroupMembers = JSON . parse ( sCurrentGroupMembers ); gs . print ( JSON . stringify ( oGroupMembers . users )); oNewGroupMember = JSON . parse ( group_members ); var oGroupConfig = getGroupDeltas ( oGroupMembers . users , oNewGroupMember ); gs . print ( JSON . stringify ( oGroupConfig . remove )); gs . print ( JSON . stringify ( oGroupConfig . add )) output : *** Script: sCurrentGroupMembers: {"manager":"3b2649efdb0f8c10cc0652f3f39xxxxx", "email":"", "type":"33a2226edb99c340edfc7cbdae96xxxx", "description":"Created for xyz", "users":[{"user":"3b2649efdb0f8c10cc0652f3f396xxxx"},{"user":"856a8f71db3d73041b4ffc45ae96196a"},{"user":"3752771