Instead of being redirected to the Catalog homepage, I want a form view to launch with details like the Requested for and Requested by and short description prepopulated.  I can manually enter whatever else may be missing.

Tom L Logan
Mega Expert

The OOTB UI Action script for "Create Request" is outlined below, how do I modify the script to first close the Incident and include closure notes and closure code before launching the Service Catalog home page?  Thank you.

 

//Update saves incidents before going to the catalog homepage
current.update();
gs.addInfoMessage('You will need to navigate back to incident ' + current.number + ' upon request completion');

var url = "catalog_home.do?sysparm_view=catalog_default&sysparm_processing_hint=setfield:request.parent=";
url += current.sys_id;

action.setRedirectURL(url);

You can use current to set your field values before the current.update(); line

so current.incident_state =. x;

current.close_code = x;

current.close_notes = x;

then current.update(); <- this line saves the current record before showing the catalog.

 

View solution in original post

Thank you Michael.  I will put this to test and report back.

Tom L Logan
Mega Expert

Hello Michael, adding the fields you specified to the script works for me.  I appreciate your assistance with this.