Add a new change request type

You can add a new change type to your change process. There are several processes involved with adding a change type. These processes include managing script includes and workflows.

Before you begin

Role required: admin

About this task

In addition to the three types of change available by default, you can add new change types based on your organization requirements. For example, you can create a change type Expedited for changes that you require to be processed immediately.

Procedure

  1. Complete the following steps to add a new choice to the Type field.
    1. Open an existing change request.
    2. Right-click the Type field and select Show Choice List.
    3. Click New and fill in the following fields.
      Field Name Description
      Table Select the Change Request table.
      Label Enter a label for the new change type. For example, Expedited.
      Value Enter a label for the new change type. For example, expedited.
      Sequence Enter a sequence for the change type. For example, 4.
    4. Submit the form.
      List of active change types
  2. Complete the following steps to add the new change type to the change request interceptor.
    1. Navigate to System Definition > Interceptors.
    2. Open the Change Request interceptor.
    3. Click New in the Answers related list and select Simple question to redirect the URL.
    4. Complete the form, as appropriate.
      Field Description
      Question Change Request
      Name Enter a name for the new change type. For example, Direct to Expedited Change.
      User Prompt Enter a description that is displayed to the end user when they click Create New under Change.
      Target URL Set the appropriate target URL. For example, change_request.do?sys_id=-1&sysparm_query=type=expedited.
      Order Set the appropriate order level for the change type. For example, 400.
    5. Submit the form.
      Add a new change type
  3. Complete the following steps to create the script include for the new change type.
    1. Navigate to System Definition > Script Includes.
    2. Search for a change type script include on which to base the workflow for the new change type. For example, to base it on Emergency change type, search for ChangeRequestStateModelSNC_emergency and open the script include.
    3. Copy the script of the ChangeRequestStateModelSNC_emergency script include from the Script field.
    4. Navigate to System Definition > Script Includes and click New.
    5. Name the new script include to match the value of the new type. For example, ChangeRequestStateModelCust_expedited.
    6. Paste the copied script in the Script field of the new script include.
    7. Update any references in the pasted script include from ChangeRequestStateModelSNC_emergency to ChangeRequestStateModelCust_expedited.
    8. Click Submit.
      Note: An existing script include contains the implementation for all the moving and canMove functions. The moving function is used to pre-populate any fields that are required for the new state. The canMove function is used to check for any additional requirements and to validate whether a task can move to the next state.
  4. Complete the following steps to create the script include to define state transitions and control the transitioning between states for the new change type.
    1. Navigate to System Definition > Script Includes.
    2. Search for change type script include on which to base the transitioning controls for the new change type on. For example, to base it on Emergency change type, search for ChangeRequestStateModel_emergency and open the script include.
    3. Update the name of the script include to match the value of the new type. For example, ChangeRequestStateModel_expedited.
    4. Update the reference to the base script include for the new change type. Change the extended Object in line 2 to the base script include name. For example, ChangeRequestStateModelCust_expedited, so the reference is similar to the following string.
      ChangeRequestStateModel_expedited.prototype = Object.extendsObject(ChangeRequestStateModelCust_expedited, {
    5. Click Insert and Stay to save the new script include.
  5. Complete the following steps to modify the script include that controls the transition between states using one of the defined models for the new change type. The base method is overridden so that the new state model for the new change type can be utilized.
    1. Navigate to System Definition > Script Includes.
    2. Search for and open the ChangeRequestStateHandler script include, which controls the transitioning between states using one of the defined models.
    3. Create a property to reference the new change request type value. For example, EXPEDITED:"expedited".
    4. Override the base method _resetModel to be able to include the new model. For example, if the change request type is expedited, then the new state model ChangeRequestStateModel_expedited is included. Example code with changes highlighted in bold:
      var ChangeRequestStateHandler = Class.create(); 
              // All references to statehandler constants should be through this class ChangeRequestStateHandler
              ChangeRequestStateHandler.DRAFT = ChangeRequestStateHandlerSNC.DRAFT;
              ChangeRequestStateHandler.ASSESS = ChangeRequestStateHandlerSNC.ASSESS;
              ChangeRequestStateHandler.AUTHORIZE = ChangeRequestStateHandlerSNC.AUTHORIZE;
              ChangeRequestStateHandler.SCHEDULED = ChangeRequestStateHandlerSNC.SCHEDULED; 
              ChangeRequestStateHandler.IMPLEMENT = ChangeRequestStateHandlerSNC.IMPLEMENT; 
              ChangeRequestStateHandler.REVIEW = ChangeRequestStateHandlerSNC.REVIEW; 
              ChangeRequestStateHandler.CLOSED = ChangeRequestStateHandlerSNC.CLOSED;
              ChangeRequestStateHandler.CANCELED = ChangeRequestStateHandlerSNC.CANCELED;
       
              ChangeRequestStateHandler.prototype = Object.extendsObject(ChangeRequestStateHandlerSNC, {
                EXPEDITED:"expedited", 
                initialize: function(changeRequestGr) {
                   ChangeRequestStateHandlerSNC.prototype.initialize.call(this, changeRequestGr);
                 }, 
                 _resetModel: function() {
                   this._model = null;
                   var type = this._gr.getValue('type') + ""; 
      
                   if (type == this.NORMAL || type == this.STANDARD || type == this.EMERGENCY) 
                      ChangeRequestStateHandlerSNC.prototype._resetModel.call(this); 
                   else if (type == this.EXPEDITED) 
                      this._model = new ChangeRequestStateModel_expedited(this._gr); 
                 }, 
      
                 type:"ChangeRequestStateHandler" 
               });
    5. Save the script include.
  6. Complete the following steps to create a workflow for the new change request type.
    1. Navigate to Workflow > Workflow Editor.
    2. Open an existing change request workflow. For example, Change Request – Emergency.
    3. Select Copy from the Actions menu to copy the workflow and name the new workflow. For example, Change Request - Expedited.
    4. Select Properties from the Actions menu to update the condition under which the new workflow executes. For example, [Type] [is] [Expedited] in the condition.
    5. Open the matching change tasks workflow that is called by the main workflow. For example, Change Request - Emergency change tasks.
    6. Select Copy from the Actions menu to copy the workflow and name the new workflow. For example, Change Request - Expedited change tasks.
    7. Select Publish from the Actions menu to publish the new change tasks workflow and make it available for use.
    8. Go back to the first workflow you created and update the Workflow activity to reference the new change tasks workflow. For example, Change Request - Expedited change tasks.
    9. Select Publish from the Actions menu to publish the new workflow and make it available for use.