Add a new change type

You can add a new change type to your change process.

Before you begin

Role required: admin

About this task

In addition to the normal, standard, and emergency types of change available by default, you can add new change types based on your organization's requirements. For example, you can create an Expedited change type for changes that you require to be expedited.

Procedure

  1. Add a new choice to the Type field.
    1. Open an existing change request.
    2. Right click on 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 choices for a change type
  2. 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 on the Answers related list and fill in the following fields, 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 will be 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.
    4. Submit the form.
  3. 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 on. 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.
    5. Click New to create a new script include.
    6. Name the new script include to match the value of the new type. For example, ChangeRequestStateModelCust_expedited.
    7. Paste the copied script in the Script field of the new script include.
    8. Update any references in the pasted script include from ChangeRequestStateModelSNC_emergency to ChangeRequestStateModelCust_expedited.
    9. Click Save to save the new script include.
      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 validate if a task can move to the next state.
  4. 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 forChangeRequestStateModel_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 ChangeRequestStateModel_expedited.prototype = Object.extendsObject(ChangeRequestStateModelCust_expedited, {.
    5. Click Insert and Stay to save the new script include.
  5. Modify the script include that controls the transitioning 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 in order to have the ability 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. 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 will execute. 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.