change_request_task – Manage ServiceNow change request tasks

Create, delete or update a ServiceNow change request tasks.

For more information, refer to the ServiceNow change management documentation at https://docs.servicenow.com/bundle/paris-it-service-management/page/product/change-management/concept/c_ITILChangeManagement.html.

New in version 1.3.0.

Examples

- name: Create a change task
  servicenow.itsm.change_request_task:
    configuration_item: Rogue Squadron Launcher
    change_request_number: CHG0000001
    type: planning
    state: open
    assigned_to: fred.luddy
    assignment_group: robot.embedded
    short_description: Implement collision avoidance
    description: "Implement collision avoidance based on the newly installed TOF sensor arrays."
    on_hold: true
    hold_reason: "Waiting for a report from the hardware team"
    planned_start_date: 2021-07-15 08:00:00
    planned_end_date: 2021-07-21 16:00:00
    other:
      approval: approved

- name: Change state of the change task
  servicenow.itsm.change_request_task:
    state: in_progress
    on_hold: false
    number: CTASK0000001

- name: Close a change task
  servicenow.itsm.change_request_task:
    state: closed
    close_code: "successful"
    close_notes: "Closed"
    number: CTASK0000001

- name: Delete a change task
  servicenow.itsm.change_request_task:
    state: absent
    number: CTASK0000001

See Also

See also

  • modules/servicenow.itsm.change_request_task_info_module

Parameters

assigned_to (optional)

The user that the change task is assigned to.

type: str
assignment_group (optional)

The group that the change task is assigned to.

type: str
change_request_id (optional)

sys_id of the change request this task belongs to.

Mutually exclusive with change_request_number.

type: str
change_request_number (optional)

number of the change request this task belongs to.

Note that contrary to change_request_id, change request number may not uniquely identify a record. In case there are more change requests with the same number, the module fails and does nothing.

Mutually exclusive with change_request_id.

type: str
change_request_task_mapping (optional)

User mapping for Change request task object, where user can override Choice Lists values for objects.

type: dict
state (optional)

The state of the change request task.

Cannot be changed to pending when on_hold is true (module fails and does nothing).

type: dict
close_code (optional)

Provide information on how the change task was resolved.

The change task must have this parameter set prior to transitioning to the closed state.

type: str
choices: successful, successful_issues, unsuccessful
close_notes (optional)

Resolution notes added by the user who closed the change task.

The change task must have this parameter set prior to transitioning to the closed state.

type: str
configuration_item (optional)

The configuration item (CI) or service name that the change task applies to.

Note that contrary to configuration_item_id, configuration item names may not uniquely identify a record. In case there are more configuration items with the same name, the module fails and does nothing.

Mutually exclusive with configuration_item_id.

type: str
configuration_item_id (optional)

The configuration item (CI) or service ID that the change task applies to.

Mutually exclusive with configuration_item.

type: str
description (optional)

A detailed description of the task.

This field has to be set either in the record or here.

type: str
hold_reason (optional)

Reason why change task is on hold.

Required if change task’s on_hold value will be true.

type: str
instance (optional)

ServiceNow instance information.

type: dict
client_id (optional)

ID of the client application used for OAuth authentication.

If not set, the value of the SN_CLIENT_ID environment variable will be used.

If provided, it requires client_secret.

type: str
client_secret (optional)

Secret associated with client_id. Used for OAuth authentication.

If not set, the value of the SN_CLIENT_SECRET environment variable will be used.

If provided, it requires client_id.

type: str
grant_type (optional)

Grant type used for OAuth authentication.

If not set, the value of the SN_GRANT_TYPE environment variable will be used.

type: str
default: password
choices: password, refresh_token
host (required)

The ServiceNow host name.

If not set, the value of the SN_HOST environment variable will be used.

type: str
password (optional)

Password used for authentication.

If not set, the value of the SN_PASSWORD environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
refresh_token (optional)

Refresh token used for OAuth authentication.

If not set, the value of the SN_REFRESH_TOKEN environment variable will be used.

Required when grant_type=refresh_token.

type: str
timeout (optional)

Timeout in seconds for the connection with the ServiceNow instance.

If not set, the value of the SN_TIMEOUT environment variable will be used.

type: float
username (optional)

Username used for authentication.

If not set, the value of the SN_USERNAME environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
number (optional)

Number of the record to operate on.

Note that contrary to sys_id, number may not uniquely identify a record.

type: str
on_hold (optional)

A change task cannot be put on hold when state is pending, canceled, or closed (module fails and does nothing).

Provide an On hold reason if a change task is placed on hold.

type: bool
other (optional)

Optional remaining parameters.

For more information on optional parameters, refer to the ServiceNow change task documentation at https://docs.servicenow.com/bundle/paris-it-service-management/page/product/change-management/task/create-a-change-task.html.

type: dict
planned_end_date (optional)

The date the change task is planned to be completed.

type: str
planned_start_date (optional)

The date you plan to begin working on the task.

type: str
short_description (optional)

A summary of the task.

This field has to be set either in the record or here.

type: str
state (optional)

The state of the change request task.

Cannot be changed to pending when on_hold is true (module fails and does nothing).

Default choices are pending, open, in_progress, closed, canceled, absent. One can override them by setting change_request_task.state.

type: str
sys_id (optional)

Unique identifier of the record to operate on.

type: str
type (optional)

The type of change task.

Default workflow generates tasks in type review.

If the task type is implementation, the planned_start_date and planned_end_date values must fall within the planned start and end dates specified in the change_request.

type: str
choices: planning, implementation, testing, review