change_request_task_info – List ServiceNow change request tasks

Retrieve information about 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: Retrieve all change request tasks
  servicenow.itsm.change_request_task_info:
  register: result

- name: Retrieve a specific change request task by its sys_id
  servicenow.itsm.change_request_task_info:
    sys_id: 471bfbc7a9fe198101e77a3e10e5d47f
  register: result

- name: Retrieve change request tasks by number
  servicenow.itsm.change_request_task_info:
    number: CTASK0000001
  register: result

- name: Retrieve change request tasks that contain SAP in their short description
  servicenow.itsm.change_request_task_info:
    query:
      - short_description: LIKE SAP
  register: result

- name: Retrieve new change requests assigned to abel.tuter or bertie.luby
  servicenow.itsm.change_request_task_info:
    query:
      - state: = new
        assigned_to: = abel.tuter
      - state: = new
        assigned_to: = bertie.luby

See Also

See also

  • modules/servicenow.itsm.change_request_task_module

Parameters

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

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

type: str
query (optional)

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.

type: list
sys_id (optional)

Unique identifier of the record to retrieve.

type: str

Return Values

records

A list of change task records.

sample:

- active: 'true'
  activity_due: ''
  additional_assignee_list: ''
  approval: not requested
  approval_history: ''
  approval_set: ''
  assigned_to: f298d2d2c611227b0106c6be7f154bc8
  assignment_group: ''
  business_duration: ''
  business_service: ''
  calendar_duration: ''
  change_request: a9e9c33dc61122760072455df62663d2
  change_task_type: ''
  close_code: ''
  close_notes: ''
  closed_at: ''
  closed_by: ''
  cmdb_ci: ''
  comments: ''
  comments_and_work_notes: ''
  company: ''
  contact_type: phone
  contract: ''
  correlation_display: ''
  correlation_id: ''
  created_from: ''
  delivery_plan: ''
  delivery_task: ''
  description: Preliminary System Testing
  due_date: '2020-09-05 22:22:39'
  escalation: '0'
  expected_start: ''
  follow_up: ''
  group_list: ''
  impact: '3'
  knowledge: 'false'
  location: ''
  made_sla: 'false'
  number: CTASK0010005
  on_hold: false
  on_hold_reason: ''
  opened_at: '2020-08-30 22:22:48'
  opened_by: 6816f79cc0a8016401c5a33be04be441
  order: ''
  parent: ''
  planned_end_date: ''
  planned_start_date: ''
  priority: '3'
  reassignment_count: ''
  route_reason: ''
  service_offering: ''
  short_description: Preliminary System Testing
  sla_due: ''
  state: open
  sys_class_name: change_task
  sys_created_by: admin
  sys_created_on: '2020-08-30 22:22:48'
  sys_domain: global
  sys_domain_path: /
  sys_id: a9f2e5bdc61122760052c1250f7ac503
  sys_mod_count: '0'
  sys_tags: ''
  sys_updated_by: admin
  sys_updated_on: '2020-08-30 22:22:48'
  task_effective_number: CTASK0010005
  time_worked: ''
  universal_request: ''
  upon_approval: ''
  upon_reject: ''
  urgency: '3'
  user_input: ''
  watch_list: ''
  work_end: ''
  work_notes: ''
  work_notes_list: ''
  work_start: ''