Skip to content

Latest commit

 

History

History
486 lines (427 loc) · 22.5 KB

servicenow.itsm.change_request_task_info_module.rst

File metadata and controls

486 lines (427 loc) · 22.5 KB

servicenow.itsm.change_request_task_info module -- List ServiceNow change request tasks

This module is part of the servicenow.itsm collection (version 2.4.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install servicenow.itsm.

To use it in a playbook, specify: servicenow.itsm.change_request_task_info.

New in servicenow.itsm 1.3.0

Synopsis

Parameters

Parameter

Comments

change_request_task_mapping

dictionary

added in servicenow.itsm 1.3.0

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

state

dictionary

The state of the change request task.

Cannot be changed to pending when on_hold is true (module fails and does nothing).

instance

dictionary

ServiceNow instance information.

access_token

string

added in servicenow.itsm 2.3.0

Access token obtained via OAuth authentication.

If not set, the value of the SN_ACCESS_TOKEN environment variable will be used.

api_path

string

added in servicenow.itsm 2.4.0

Change the API endpoint of SNOW instance from default 'api/now'.

Default: "api/now"

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.

custom_headers

dictionary

added in servicenow.itsm 2.4.0

A dictionary containing any extra headers which will be passed with the request.

grant_type

string

added in servicenow.itsm 1.1.0

Grant type used for OAuth authentication.

If not set, the value of the SN_GRANT_TYPE environment variable will be used.

Since version 2.3.0, it no longer has a default value in the argument specifications.

If not set by any means, the default value (that is, password) will be set internally to preserve backwards compatibility.

Choices:

  • "password"

  • "refresh_token"

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 servicenow.itsm 1.1.0

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.

validate_certs

boolean

added in servicenow.itsm 2.3.0

If host's certificate is validated or not.

Choices:

  • false

  • true ← (default)

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/tokyo-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html.

Mutually exclusive with sysparm_query.

sys_id

string

Unique identifier of the record to retrieve.

sysparm_display_value

string

added in servicenow.itsm 2.0.0

Return field display values true, actual values false, or both all.

Choices:

  • "true"

  • "false" ← (default)

  • "all"

sysparm_query

string

added in servicenow.itsm 2.0.0

An encoded query string used to filter the results as an alternative to query.

Refer to the ServiceNow Available Filters Queries documentation at https://docs.servicenow.com/bundle/tokyo-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html.

If not set, the value of the SN_SYSPARM_QUERY environment, if specified.

Mutually exclusive with query.

See Also

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 by using field query
  servicenow.itsm.change_request_task_info:
    query:
      - short_description: LIKE SAP
  register: result

- name: Retrieve change request tasks that contain SAP in their short description by using field sysparm-query
  servicenow.itsm.change_request_task_info:
    sysparm_query: short_descriptionLIKESAP
  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

Return Values

The following are the fields unique to this module:

Key

Description

records

list / elements=string

A list of change task records.

Returned: success

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": ""}]

Authors

  • Matej Pevec (@mysteriouswolf)
  • Manca Bizjak (@mancabizjak)
  • Miha Dolinar (@mdolin)
  • Tadej Borovsak (@tadeboro)