List ServiceNow change requests
Version added: 1.0.0
- Retrieve information about ServiceNow change requests.
- 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 | |
---|---|---|---|
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.
|
||
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 retrieve.
Note that contrary to sys_id, number may not uniquely identify a record.
|
||
query
list
/ elements=dictionary
|
Provides a set of operators for use with filters, condition builders, and encoded queries.
The data type of a field determines what operators are available for it. Refer to the ServiceNow Available Filters Queries documentation at https://docs.servicenow.com/bundle/quebec-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html.
|
||
sys_id
string
|
Unique identifier of the record to retrieve.
|
servicenow.itsm.change_request_module
The official documentation on the servicenow.itsm.change_request module.
- name: Retrieve all change requests
servicenow.itsm.change_request_info:
register: result
- name: Retrieve a specific change request by its sys_id
servicenow.itsm.change_request_info:
sys_id: 471bfbc7a9fe198101e77a3e10e5d47f
register: result
- name: Retrieve change requests by number
servicenow.itsm.change_request_info:
number: PRB0007601
register: result
- name: Retrieve change requests that contain SAP in its short description
servicenow.itsm.change_request_info:
query:
- short_description: LIKE SAP
register: result
- name: Retrieve new change requests assigned to abel.tuter or bertie.luby
servicenow.itsm.change_request_info:
query:
- state: = new
assigned_to: = abel.tuter
- state: = new
assigned_to: = bertie.luby
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
records
list
|
success |
A list of change request records.
Sample:
[{'active': 'false', 'activity_due': '', 'additional_assignee_list': '', 'approval': 'approved', 'approval_history': '', 'approval_set': '', 'assigned_to': '', 'assignment_group': 'd625dccec0a8016700a222a0f7900d06', 'attachments': [{'average_image_color': '', 'chunk_size_bytes': '700000', 'compressed': 'true', 'content_type': 'text/plain', 'download_link': 'https://www.example.com/api/now/attachment/5f7d3c950706301022f9ffa08c1ed062/file', 'file_name': 'sample_file1.txt', 'hash': '6f2b0dec698566114435a23f15dcac848a40e1fd3e0eda4afe24a663dda23f2e', 'image_height': '', 'image_width': '', 'size_bytes': '210', 'size_compressed': '206', 'state': 'pending', 'sys_created_by': 'admin', 'sys_created_on': '2021-08-17 11:18:33', 'sys_id': '5f7d3c950706301022f9ffa08c1ed062', 'sys_mod_count': '0', 'sys_tags': '', 'sys_updated_by': 'admin', 'sys_updated_on': '2021-08-17 11:18:33', 'table_name': 'change_request', 'table_sys_id': '3a7db0d50706301022f9ffa08c1ed092'}], 'backout_plan': '', 'business_duration': '', 'business_service': '', 'cab_date': '', 'cab_delegate': '', 'cab_recommendation': '', 'cab_required': 'false', 'calendar_duration': '', 'category': 'Other', 'change_plan': '', 'close_code': 'successful', 'close_notes': 'Completed successfully', 'closed_at': '2015-07-06 18:18:53', 'closed_by': '6816f79cc0a8016401c5a33be04be441', 'cmdb_ci': '', 'comments': '', 'comments_and_work_notes': '', 'company': '', 'conflict_last_run': '', 'conflict_status': 'Not Run', 'contact_type': 'phone', 'contract': '', 'correlation_display': '', 'correlation_id': '', 'delivery_plan': '', 'delivery_task': '', 'description': 'Decommission a server', 'due_date': '', 'end_date': '', 'escalation': '0', 'expected_start': '', 'follow_up': '', 'group_list': '', 'impact': '3', 'implementation_plan': 'Implementation plan', 'justification': '', 'knowledge': 'false', 'location': '', 'made_sla': 'true', 'number': 'CHG0000023', 'on_hold': 'false', 'on_hold_reason': '', 'on_hold_task': '', 'opened_at': '2015-07-06 18:17:21', 'opened_by': '6816f79cc0a8016401c5a33be04be441', 'order': '', 'outside_maintenance_schedule': 'false', 'parent': '', 'phase': 'requested', 'phase_state': 'open', 'priority': '4', 'production_system': 'false', 'reason': '', 'reassignment_count': '2', 'requested_by': '6816f79cc0a8016401c5a33be04be441', 'requested_by_date': '', 'review_comments': '', 'review_date': '', 'review_status': '', 'risk': '3', 'risk_impact_analysis': '', 'route_reason': '', 'scope': '3', 'service_offering': '', 'short_description': 'Decommission server', 'sla_due': '', 'start_date': '', 'state': '3', 'std_change_producer_version': 'deb8544047810200e90d87e8dee490af', 'sys_class_name': 'change_request', 'sys_created_by': 'admin', 'sys_created_on': '2015-07-06 18:17:22', 'sys_domain': 'global', 'sys_domain_path': '/', 'sys_id': '70ad699e47410200e90d87e8dee4907d', 'sys_mod_count': '8', 'sys_tags': '', 'sys_updated_by': 'admin', 'sys_updated_on': '2015-07-06 18:18:53', 'task_effective_number': 'CHG0000023', 'test_plan': 'Test plan', 'time_worked': '', 'type': 'standard', 'unauthorized': 'false', 'universal_request': '', 'upon_approval': 'proceed', 'upon_reject': 'cancel', 'urgency': '3', 'user_input': '', 'watch_list': '', 'work_end': '2015-07-06 18:18:34', 'work_notes': '', 'work_notes_list': '', 'work_start': '2015-07-06 18:17:41'}]
|
- Manca Bizjak (@mancabizjak)
- Miha Dolinar (@mdolin)
- Tadej Borovsak (@tadeboro)
- Matej Pevec (@mysteriouswolf)