servicenow.servicenow.snow_record_find – Search for multiple records from ServiceNow¶
Note
This plugin is part of the servicenow.servicenow collection (version 1.0.4).
To install it use: ansible-galaxy collection install servicenow.servicenow
.
To use it in a playbook, specify: servicenow.servicenow.snow_record_find
.
Requirements¶
The below requirements are needed on the host that executes this module.
python pysnow (pysnow)
Parameters¶
Examples¶
- name: Search for incident assigned to group, return specific fields
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
instance: dev99999
table: incident
query:
assignment_group: d625dccec0a8016700a222a0f7900d06
return_fields:
- number
- opened_at
- name: Search for incident using host instead of instance
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
host: dev99999.mycustom.domain.com
table: incident
query:
assignment_group: d625dccec0a8016700a222a0f7900d06
return_fields:
- number
- opened_at
- name: Using OAuth, search for incident assigned to group, return specific fields
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
client_id: "1234567890abcdef1234567890abcdef"
client_secret: "Password1!"
instance: dev99999
table: incident
query:
assignment_group: d625dccec0a8016700a222a0f7900d06
return_fields:
- number
- opened_at
- name: Find open standard changes with my template
servicenow.servicenow.snow_record_find:
username: ansible_test
password: my_password
instance: dev99999
table: change_request
query:
AND:
equals:
active: "True"
type: "standard"
u_change_stage: "80"
contains:
u_template: "MY-Template"
return_fields:
- sys_id
- number
- sys_created_on
- sys_updated_on
- u_template
- active
- type
- u_change_stage
- sys_created_by
- description
- short_description
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
record
dictionary
|
always |
The full contents of the matching ServiceNow records as a list of records.
|
Authors¶
Tim Rightnour (@garbled1)