Update the state model script include
Update the ChangeRequestStateModel_normal script include to add new functions for the Complete state.
Before you begin
Role required: admin
About this task
You update the ChangeRequestStateModel_normal with the following configuration.
-
Add new canMove and moving functions for the Complete state. These functions can return a value of true since there are no special conditions for or extra actions to perform when moving to the Complete state.
-
Modify the definition of the existing object for the Implement state to ensure that the next state is Complete.
-
Add an object for the Complete state, which defines Review and Closed as the next two states.
Note: The canMove functions for the transition to these states from Complete checks the Needs review custom field to determine the correct next state.
Procedure
-
Navigate to All > System Definition > Script Includes.
-
Open the ChangeRequestStateModel_normal script include and modify the script as follows.
-
Add the following line at the end of the script include but before the line that starts with type:
JavaScripttoComplete_moving: function() { return true; }, toComplete_canMove: function() { return true; }, -
Modify the existing implement object to toComplete:
JavaScriptimplement: { nextState: [ "complete" ], complete: { moving: function() { return this.toComplete_moving(); }, canMove: function() { return this.toComplete_canMove(); } }, canceled: { moving: function() { return this.toCanceled_moving(); }, canMove: function() { return this.toCanceled_canMove(); } } },
-
-
Add the following new state object for complete.
JavaScriptcomplete: { nextState : [ "review", "closed" ], review : { moving : function() { return this.toReview_moving(); }, canMove : function() { if (this._gr.getValue("u_needs_review") == "Yes") return true; return false; } }, closed : { moving : function() { return this.toClosed_moving(); }, canMove : function() { if (this._gr.getValue("u_needs_review") == "No") return true; return false; } }, canceled : { moving : function() { return this.toCanceled_moving(); }, canMove : function() { return this.toCanceled_canMove(); } } }, -
Select Update.
Parent Topic:Tutorial: Add a new change management state
Previous topic:Update the state handler script include
Next topic:Create a UI action
---
title: Update the state model script include
description: Update the ChangeRequestStateModel\_normal script include to add new functions for the Complete state.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/it-service-management/change-management/t\_UpdateStateModelScriptInclude.html
release: brazil
product: Change Management
classification: change-management
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Tutorial: Add a new change management state, Reference, Change Management, IT Service Management]
---
# Update the state model script include
Update the ChangeRequestStateModel\_normal script include to add new functions for the **Complete** state.
## Before you begin
Role required: admin
## About this task
You update the ChangeRequestStateModel\_normal with the following configuration.
- Add new *canMove* and *moving* functions for the **Complete** state. These functions can return a value of **true** since there are no special conditions for or extra actions to perform when moving to the **Complete** state.
- Modify the definition of the existing object for the **Implement** state to ensure that the next state is **Complete**.
- Add an object for the **Complete** state, which defines **Review** and **Closed** as the next two states.
**Note:** The *canMove* functions for the transition to these states from **Complete** checks the **Needs review** custom field to determine the correct next state.
## Procedure
1. Navigate to **All** > **System Definition** > **Script Includes**.
2. Open the ChangeRequestStateModel\_normal script include and modify the script as follows.
1. Add the following line at the end of the script include but before the line that starts with **type**:
```
toComplete_moving: function() {
return true;
},
toComplete_canMove: function() {
return true;
},
```
2. Modify the existing *implement* object to *toComplete*:
```
implement: {
nextState: [ "complete" ],
complete: {
moving: function() {
return this.toComplete_moving();
},
canMove: function() {
return this.toComplete_canMove();
}
},
canceled: {
moving: function() {
return this.toCanceled_moving();
},
canMove: function() {
return this.toCanceled_canMove();
}
}
},
```
3. Add the following new state object for *complete*.
```
complete: {
nextState : [ "review", "closed" ],
review : {
moving : function() {
return this.toReview_moving();
},
canMove : function() {
if (this._gr.getValue("u_needs_review") == "Yes")
return true;
return false;
}
},
closed : {
moving : function() {
return this.toClosed_moving();
},
canMove : function() {
if (this._gr.getValue("u_needs_review") == "No")
return true;
return false;
}
},
canceled : {
moving : function() {
return this.toCanceled_moving();
},
canMove : function() {
return this.toCanceled_canMove();
}
}
},
```
4. Select **Update**.
**Parent Topic:**[Tutorial: Add a new change management state](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/it-service-management/change-management/t_AddNewStateTutorial.md)
**Previous topic:**[Update the state handler script include](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/it-service-management/change-management/t_UpdateStateHandlerScriptInclude.md)
**Next topic:**[Create a UI action](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/it-service-management/change-management/t_CreateNewUIAction.md)
| title | Update the state model script include |
| description | Update the ChangeRequestStateModel\_normal script include to add new functions for the Complete state. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/it-service-management/change-management/t\_UpdateStateModelScriptInclude.html |
| release | brazil |
| product | Change Management |
| classification | change-management |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | {"Tutorial":"Add a new change management state"}ReferenceChange ManagementIT Service Management |