---
sourceDocument: Australia IT Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/it-service-management

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Create a UI action

# Create a UI action {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Create a UI action to display a button on a change request for the
Complete state.

## Antes de Iniciar

Role required: admin

## Por Que e Quando Desempenhar Esta Tarefa

The UI action must contain a condition that uses the state model script include to
decide when the Complete button is displayed on the Change
Request form. In this case, the Complete button is displayed
only when the change has reached the Implement state.

## Procedimento

1. Open the Change Request form.
2. Open the form context menu and select ConfigureUI Actions.
3. Locate and open the existing Implement UI action.
4. Open the form context menu and click Insert and Stay to create a duplicate record.
5. Modify the following fields with new values.  
   {#t_CreateNewUIAction__table_mpc_zd1_4v__entry__2}

   | Field | Values |
   |-|-|
   | Name | Complete. |
   | Action name | state_model_move_to_complete. |
   | Hint | Progresses change to Complete state. |
   | Onclick | `moveToComplete();`. |
   | Condition | gs.hasRole('itil') \&\& new ChangeRequestStateHandler(current).isNext("complete") |
   | Script | Update function, state name, and state value. function moveToComplete(){ var ga = new GlideAjax("ChangeRequestStateHandlerAjax"); ga.addParam("sysparm_name", "getStateValue"); ga.addParam("sysparm_state_name", "complete"); ga.getXMLAnswer(function(stateValue) { g_form.setValue("state", stateValue); gsftSubmit(null, g_form.getFormElement(), "state_model_move_to_complete"); }); } if (typeof window == 'undefined') setRedirect(); function setRedirect() { current.update(); action.setRedirectURL(current); } . |
   [ ]

   {#t_CreateNewUIAction__table_mpc_zd1_4v}
6. Click Update.
**Tópico anterior:** [Update the state model script include](https://servicenow-prod.fluidtopics.net/68sVQ1A6_fNLBNI2ywZb7w "Update the ChangeRequestStateModel_normal script include to add new functions for the Complete state.")  
**Próximo tópico:** [Create a process flow record](https://servicenow-prod.fluidtopics.net/QADK6acC23c7wWCrYb_Tog "Create and add a process flow record for the Complete state. The process flow formatter displays at the top of the Change Request form.")

