Manage ServiceNow change requests
Version added: 1.0.0
- 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.
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
assignment_group
string
|
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 . |
||
attachments
list
/ elements=dictionary
added in 1.2.0 of servicenow.itsm
|
ServiceNow attachments.
|
||
name
string
|
Name of the file to be uploaded without the file extension.
If not specified, the module will use path's base name.
|
||
path
string
/ required
|
Path to the file to be uploaded.
|
||
type
string
|
MIME type of the file to be attached.
If not specified, the module will try to guess the file's type from its extension.
|
||
category
string
|
|
The category of the change request.
|
|
change_request_mapping
dictionary
added in 1.3.0 of servicenow.itsm
|
User mapping for Change request object, where user can override Choice Lists values for objects.
|
||
impact
dictionary
|
Impact is a measure of the effect of an incident, problem, or change on business processes.
|
||
priority
dictionary
|
Priority is based on impact and urgency, and it identifies how quickly the service desk should address the task.
|
||
risk
dictionary
|
The risk level for the change.
|
||
state
dictionary
|
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. |
||
urgency
dictionary
|
The extent to which resolution of an change request can bear delay.
|
||
close_code
string
|
|
Provide information on how the change request was resolved.
The change request must have this parameter set prior to transitioning to the
closed state. |
|
close_notes
string
|
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. |
||
description
string
|
A detailed description of the change request.
|
||
hold_reason
string
|
Reason why change request is on hold.
Required if change request's on_hold value will be
true . |
||
impact
string
|
|
Impact is a measure of the effect of an incident, problem, or change on business processes.
|
|
instance
dictionary
|
ServiceNow instance information.
|
||
client_id
string
|
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.
|
||
client_secret
string
|
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.
|
||
grant_type
string
added in 1.1.0 of servicenow.itsm
|
|
Grant type used for OAuth authentication.
If not set, the value of the
SN_GRANT_TYPE environment variable will be used. |
|
host
string
/ required
|
The ServiceNow host name.
If not set, the value of the
SN_HOST environment variable will be used. |
||
password
string
|
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.
|
||
refresh_token
string
added in 1.1.0 of servicenow.itsm
|
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.
|
||
timeout
float
|
Timeout in seconds for the connection with the ServiceNow instance.
If not set, the value of the
SN_TIMEOUT environment variable will be used. |
||
username
string
|
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.
|
||
number
string
|
Number of the record to operate on.
Note that contrary to sys_id, number may not uniquely identify a record.
|
||
on_hold
boolean
|
|
A change request can be put on hold when state is not in the
new , canceled , or closed . |
|
other
dictionary
|
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.
|
||
priority
string
|
|
Priority is based on impact and urgency, and it identifies how quickly the service desk should address the task.
|
|
requested_by
string
|
User who requested the change.
|
||
risk
string
|
|
The risk level for the change.
|
|
short_description
string
|
A summary of the change request.
|
||
state
string
|
|
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
|
|
sys_id
string
|
Unique identifier of the record to operate on.
|
||
template
string
|
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
string
|
|
Specify what type of change is required.
|
|
urgency
string
|
|
The extent to which resolution of an change request can bear delay.
|
servicenow.itsm.change_request_info_module
The official documentation on the servicenow.itsm.change_request_info module.
- 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
- Manca Bizjak (@mancabizjak)
- Miha Dolinar (@mdolin)
- Tadej Borovsak (@tadeboro)
- Matej Pevec (@mysteriouswolf)