change_request – Manage ServiceNow change requests

Create, delete or update a ServiceNow change request.

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.0.0.

Examples

- name: Create change request
  servicenow.itsm.change_request:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    type: standard
    state: new
    requested_by: some.user
    short_description: Install new Cisco
    description: Please install new Cat. 6500 in Data center 01
    attachments:
      - path: path/to/attachment.txt
    priority: moderate
    risk: low
    impact: low

    other:
      expected_start: 2021-02-12

- name: Change state of the change request
  servicenow.itsm.change_request:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: assess
    assignment_group: some.group
    number: CHG0000001

- name: Close change_request
  servicenow.itsm.change_request:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: closed
    close_code: "successful"
    close_notes: "Closed"
    assignment_group: some.group
    number: CHG0000001

- name: Delete change_request
  servicenow.itsm.change_request:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: absent
    number: CHG0000001

See Also

See also

  • modules/servicenow.itsm.change_request_info_module

Parameters

assignment_group (optional)

The group that the change request is assigned to.

Required if state value is assess or authorize or scheduled or implement or review or closed.

type: str
attachments (optional)

ServiceNow attachments.

type: list
name (optional)

Name of the file to be uploaded without the file extension.

If not specified, the module will use path’s base name.

type: str
path (required)

Path to the file to be uploaded.

type: str
type (optional)

MIME type of the file to be attached.

If not specified, the module will try to guess the file’s type from its extension.

type: str
category (optional)

The category of the change request.

type: str
choices: hardware, software, service, system_software, aplication_software, network, telecom, documentation, other
change_request_mapping (optional)

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

type: dict
impact (optional)

Impact is a measure of the effect of an incident, problem, or change on business processes.

type: dict
priority (optional)

Priority is based on impact and urgency, and it identifies how quickly the service desk should address the task.

type: dict
risk (optional)

The risk level for the change.

type: dict
state (optional)

The state of the change request.

If state value is assess or authorize or scheduled or implement or review or closed, assignment_group parameter must be filled in. In case that any field is renamed, that check is not performed there.

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

Special value that can not be overridden is absent, which would remove a change request from ServiceNow.

type: dict
urgency (optional)

The extent to which resolution of an change request can bear delay.

type: dict
close_code (optional)

Provide information on how the change request was resolved.

The change request 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 request.

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

type: str
description (optional)

A detailed description of the change request.

type: str
hold_reason (optional)

Reason why change request is on hold.

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

type: str
impact (optional)

Impact is a measure of the effect of an incident, problem, or change on business processes.

Default choices are high, medium, low. One can override them by setting change_request_mapping.impact.

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 request can be put on hold when state is not in the new, canceled, or closed.

type: bool
other (optional)

Optional remaining parameters.

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

type: dict
priority (optional)

Priority is based on impact and urgency, and it identifies how quickly the service desk should address the task.

Default choices are critical, high, moderate, low. One can override them by setting change_request_mapping.priority.

type: str
requested_by (optional)

User who requested the change.

type: str
risk (optional)

The risk level for the change.

Default choices are high, moderate, low. One can override them by setting change_request_mapping.risk.

type: str
short_description (optional)

A summary of the change request.

type: str
state (optional)

The state of the change request.

If state value is assess or authorize or scheduled or implement or review or closed, assignment_group parameter must be filled in.

For more information on state model and transition, refere to the ServiceNow documentation at https://docs.servicenow.com/bundle/paris-it-service-management/page/product/change-management/concept/c_ChangeStateModel.html

Default choices are new, assess, authorize, scheduled, implement, review, closed, canceled, absent. One can override them by setting change_request_mapping.state.

type: str
sys_id (optional)

Unique identifier of the record to operate on.

type: str
template (optional)

Predefined template name for standard change request.

For more information on templates refer to ServiceNow documentation at https://docs.servicenow.com/bundle/quebec-it-service-management/page/product/change-management/concept/c_StandardChangeCatalogPlugin.html or find template names on <your_service_id>.service-now.com/nav_to.do?uri=%2Fstd_change_producer_version_list.do%3F

type: str
type (optional)

Specify what type of change is required.

type: str
choices: standard, normal, emergency
urgency (optional)

The extent to which resolution of an change request can bear delay.

Default choices are high, medium, low. One can override them by setting change_request_mapping.urgency.

type: str