Creating ServiceNow task

A ServiceNow™ task can create and update ServiceNow change requests and the change tasks within the change request. You can also create a ServiceNow - Wait Change Request task which will wait for the specified value to appear in a specific field of a change request in ServiceNow.

Before you begin

You must have completed the following tasks:

  • Ensured that you have internet-accessible instances of ServiceNow, such as my_instance.service-now.com.
  • Created an integration with ServiceNow plug-in. For more information, refer to ServiceNow plug-in documentation.
    Note: Ensure that the credentials used for the plug-in integration must have access to the ServiceNow API and permission to see and modify all change request fields. At a minimum, the user must be in a ServiceNow role that has the Create Change permission.

About this task

You can create the following automation tasks with which you can perform the actions in ServiceNow directly from Velocity:

  • ServiceNow - Create Change Request and Change Task

    This task creates a change request, change task or both in ServiceNow.

  • ServiceNow - Update Change Request and Change Task

    This task updates the value in any change request, change task, or both in ServiceNow.

  • ServiceNow - Wait Change Request

    This task waits for specified value to appear in a specified field of a change request in ServiceNow. The task will be completed when the provided value appears in the ServiceNow change request. The field can be any field of a change request.

Procedure

  1. Click Releases on the left navigation pane.
    The Releases page is displayed.
  2. Click any deployment plan.
    The Deployment plan detail page is displayed.
  3. Click Create Task.
    If you want to insert a task at a specific position in the plan, select a task before using the Create Task. The new task is inserted above the selected task.
    The Create Task dialog is displayed.
  4. In the Type list, select any one of the following options based on the action that you want to perform in ServiceNow:
    • ServiceNow - Create Change Request and Change Task
    • ServiceNow - Update Change Request and Change Task
    • ServiceNow - Wait Change Request
  5. In the Name field, enter a name for the task.
  6. In the Description field, enter the description for the task.
  7. In the Integration field, select the integration which you have created for ServiceNow.
  8. Based on the task type you selected, enter the details in the task specific parameters, as described in the following tables:
    Table 1. ServiceNow - Create Change Request and Change Task
    ServiceNow - Create Change Request and Change Task type Description
    Short description for change request Enter the text that you want to display in the Short description field of the ServiceNow change request.
    Request type Enter the ServiceNow request type. you can use the ServiceNow default types or a user-created type. Default types are normal, emergency, and standard. Normal requests pass through all stages of the ServiceNow state model. Standard types are pre-authorized and skip the Assess and Authorize states. Emergency types skip the Assess state.
    Assignment group for change request Enter the ServiceNow agent or group responsible for resolving the change request. Possible assignees include agents and groups available to the ServiceNow instance.
    Additional properties for change request Enter the ServiceNow properties that you want to update by this task while creating the change request. For example, a simple create change request might include the following fragments: {"approval:requested"}.
    Create change task Enter the ServiceNow properties that you want to update by this task while creating the change task within the change request. You can create multiple change task by separating each change task properties object by a comma. For example, a simple create change task might include the following fragments:[{"short_description":"createtask","change_task_type":"planning","description":"changetask"}]
    Table 2. ServiceNow - Update Change Request and Change Task
    ServiceNow - Update Change Request and Change Task type Description
    Change Request Number Select the Change Request Number of the ServiceNow change request that you want to update. See the Properties reference for information about properties.
    Change request properties Enter the ServiceNow properties that you want to update by this task while updating the change request. For example, to update the state of the change request, you can specify or {"state:-1"}.
    Update change task Enter the ServiceNow properties that you want to update by this task while updating the change task within the change request. You can update multiple change task by separating each change task properties object by a comma. For example, to update the state of the change task, you can specify or [{"state:3"}].
    Table 3. ServiceNow - Wait Change Request
    ServiceNow - Wait Change Request type Description
    Change Request Number Select the Change Request Number of the ServiceNow change request. See the Properties reference for information about properties.
    Field Enter the name of the field for which the task should check for a match in the ServiceNow change request. The value in the field is checked for updates in a regular interval. For example, if you want to check for a match in the approval field, you might specify `approval`.
    Value Enter the value expected in the ServiceNow field defined in the Field property. For example, if you are checking the approval field, you can specify a value `approved`. In this example, when the value in the approval field changes to `approved` in ServiceNow, the task completes successfully.
  9. Click Save or Save and create another to add the task or add the task and create another task respectively.
    When the task starts, it will have the status of In progress. The status changes to Complete when the action mentioned in the task is performed in ServiceNow.

Example

Additional Information

The ServiceNow change request life cycle is referred to as the state model. As a change request is used, it progresses through the various states of model. For example, the state of a closed request is 'closed'.

In Velocity, ServiceNow tasks are frequently used to change the state of a change request and change task.

To modify a request state, you use the ServiceNow `state` property. For example, to change the state of a change request to Review, you can specify "state:0" in the Change request properties field of a ServiceNow - Update Change Request and Change Task type and to change the state of a change task to In progress, you can specify "state:2" in the Update change task field of a ServiceNow - Update Change Request and Change Task type.

The following table provides the values for the default states for the normal change request type. For more information, see the configure dictionary for the state property in the ServiceNow documentation.

Table 4. ServiceNow normal change request state model
State Value
New -5
Assess -4
Authorize -3
Scheduled -2
Implement -1
Review 0
Closed 3
Canceled 4

The following table provides the values for the default states for the normal change task type. For more information, see the configure dictionary for the state property in the ServiceNow documentation.

Table 5. ServiceNow normal change task state model
State Value
pending -5
open 1
in progress 2
closed 3
canceled 4