{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":31850,"path":"it-service-management/change-management/t_ConfigStateModelTransit.md","title":"Configure state model transitions","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure state model transitions\n\nYou can use script includes or UI policies to configure state models and the criteria for moving change requests from one state to another.\n\n## Before you begin\n\nRole required: script\\_include\\_admin, ui\\_policy\\_admin, or admin\n\n## Procedure\n\n1.  Complete the following steps to add state change criteria in a script include that enables a state transition.\n\n    **Note:** Before editing a **Script Include** consider configuring state transitions through Change Models and Model State Transitions as it doesn't require scripting. For the configuration approach, see [Create predefined transition condition types](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/change-management/create-predefined-transition-condition-type.md)\n\n    You can configure state transitions in two ways:\n\n    -   **Configuration:** Use Change Models and Model State Transitions to define transition conditions without scripting. This approach applies to most requirements.\n    -   **Script includes or UI policies:** Use these methods when transition logic requires conditions that the configuration approach cannot express.\n    1.  Navigate to **System Definitions** &gt; **Script Includes**.\n\n    2.  Open the script include for the state transition model that you want to edit.\n\n        |State transition model|Script include|\n        |----------------------|--------------|\n        |Normal|ChangeRequestStateModel\\_normal|\n        |Standard|ChangeRequestStateModel\\_standard|\n        |Emergency|ChangeRequestStateModel\\_emergency|\n\n    3.  Modify the appropriate method **canMove** method in the script include.\n\n        For example, to add a condition for a normal change to transition from the New state to the Authorized state, modify the **draft.authorized.canMove\\(\\)** method in the **ChangeRequestStateModel\\_normal** script include. In the script, the GlideRecord you are acting on can be referenced using the **this.\\_gr** variable.\n\n        The **canMove** method is part of a structure that defines the transitions available to the change type. The **canMove** method is contained in the **currentState.nextState.canMove\\(\\)** structure.\n\n2.  Complete the following steps to use a UI policy to add new criteria for state transitions.\n\n    1.  Navigate to **System UI** &gt; **UI Policies**.\n\n    2.  Open a default UI policy to edit or select **New** to create a new policy.\n\n        The following are the default UI policies.\n\n        |UI Policy|Description|\n        |---------|-----------|\n        |Show|CAB fields for normal and emergency changes from the **Authorize** state and onwards.|\n        |Mandatory|**Assignment Group** field.|\n        |Mandatory|**Close notes** and **Code** fields when in the **Closed** state.|\n\n        **Note:** In both of the mandatory UI policies, the state of the change request determines the mandatory fields. For **Show - CAB** fields, the type of change is also taken into account because standard changes do not require approval.\n\n    3.  Complete and save the UI policy.\n\n\n**Parent Topic:**[Legacy: State model and transitions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/change-management/c_ChangeStateModel.md)\n\n"}}