A common feature request for Service Portal is to be able to add custom buttons to the sc_request or ticket page similar to the way you could add UI actions to a form. This functionality is not available out-of-box, but here is a quick example on how you could create a custom widget to display some buttons to mimic the UI Actions on a form.

In this example, we will create a “Resolve Incident” button to place on the incident “ticket” page.

HTML:

1 2 3 4 5 6 7 < div class = "panel panel-default" > < div class = "panel-heading" > Actions < / div > < div class = "panel-body" > < button type = "button" class = "btn btn-primary btn-block" ng - click = "c.uiAction('resolve')" > Resolve Incident < / button > < button type = "button" class = "btn btn-default btn-block" ng - click = "c.uiAction('cancel')" > Cancel < / button > < / div > < / div >

Client Script:

1 2 3 4 5 6 7 8 9 function ( ) { var c = this ; c . uiAction = function ( action ) { c . data . action = action ; c . server . update ( ) . then ( function ( ) { c . data . action = undefined ; } ) } }

Server Script:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ( function ( ) { // Get table & sys_id data . table = input . table || $ sp . getParameter ( "table" ) ; data . sys_id = input . sys_id || $ sp . getParameter ( "sys_id" ) ; // Valid GlideRecord gr = new GlideRecord ( data . table ) ; if ( ! gr . isValid ( ) ) return ; // Valid sys_id if ( ! gr . get ( data . sys_id ) ) return ; if ( input && input . action ) { var action = input . action ; // If Incident table if ( data . table == 'incident' ) { if ( action == 'resolve' ) { // Resolve Incident gr . setValue ( 'incident_state' , 6 ) ; gr . setValue ( 'state' , 6 ) ; gr . setValue ( 'resolved_by' , gs . getUserID ( ) ) ; gr . update ( ) ; } if ( action == 'cancel' ) { // Do something else } } } } ) ( ) ;

The resulting widget should look something like this:

This is far from the complete solution, but will hopefully provide a good example to work off of.