Skip to content

Latest commit

 

History

History
671 lines (620 loc) · 28.3 KB

servicenow.itsm.change_request_task_module.rst

File metadata and controls

671 lines (620 loc) · 28.3 KB

servicenow.itsm.change_request_task module -- Manage ServiceNow change request tasks

This module is part of the servicenow.itsm collection (version 2.7.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.

New in servicenow.itsm 1.3.0

Parameter

Comments

assigned_to

string

The user that the change task is assigned to.

assignment_group

string

The name of the group that the change task is assigned to.

Mutually exclusive with assignment_group_id.

assignment_group_id

string

added in servicenow.itsm 2.4.0

The id of the group that the change task is assigned to.

Mutually exclusive with assignment_group.

change_request_id

string

sys_id of the change request this task belongs to.

Mutually exclusive with change_request_number.

change_request_number

string

number of the change request this task belongs to.

Note that contrary to change_request_id, change request number may not uniquely identify a record. In case there are more change requests with the same number, the module fails and does nothing.

Mutually exclusive with change_request_id.

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

close_code

string

Provide information on how the change task was resolved.

The change task must have this parameter set prior to transitioning to the closed state.

Choices:

  • "successful"

  • "successful_issues"

  • "unsuccessful"

close_notes

string

Resolution notes added by the user who closed the change task.

The change task must have this parameter set prior to transitioning to the closed state.

configuration_item

string

The configuration item (CI) or service name that the change task applies to.

Note that contrary to configuration_item_id, configuration item names may not uniquely identify a record. In case there are more configuration items with the same name, the module fails and does nothing.

Mutually exclusive with configuration_item_id.

configuration_item_id

string

The configuration item (CI) or service ID that the change task applies to.

Mutually exclusive with configuration_item.

description

string

A detailed description of the task.

This field has to be set either in the record or here.

hold_reason

string

Reason why change task is on hold.

Required if change task's on_hold value will be true.

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 operate on.

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

on_hold

boolean

A change task cannot be put on hold when state is pending, canceled, or closed (module fails and does nothing).

Provide an On hold reason if a change task is placed on hold.

Choices:

  • false

  • true

other

dictionary

Optional remaining parameters.

For more information on optional parameters, refer to the ServiceNow change task documentation at https://docs.servicenow.com/bundle/tokyo-it-service-management/page/product/change-management/task/create-a-change-task.html.

planned_end_date

string

The date the change task is planned to be completed.

planned_start_date

string

The date you plan to begin working on the task.

short_description

string

A summary of the task.

This field has to be set either in the record or here.

state

string

The state of the change request task.

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

Default choices are pending, open, in_progress, closed, canceled, absent. One can override them by setting change_request_task.state.

sys_id

string

Unique identifier of the record to operate on.

type

string

The type of change task.

Default workflow generates tasks in type review.

If the task type is implementation, the planned_start_date and planned_end_date values must fall within the planned start and end dates specified in the change_request.

Choices:

  • "planning"

  • "implementation"

  • "testing"

  • "review"

- name: Create a change task
  servicenow.itsm.change_request_task:
    configuration_item: Rogue Squadron Launcher
    change_request_number: CHG0000001
    type: planning
    state: open
    assigned_to: fred.luddy
    assignment_group: robot.embedded
    short_description: Implement collision avoidance
    description: "Implement collision avoidance based on the newly installed TOF sensor arrays."
    on_hold: true
    hold_reason: "Waiting for a report from the hardware team"
    planned_start_date: 2021-07-15 08:00:00
    planned_end_date: 2021-07-21 16:00:00
    other:
      approval: approved

- name: Change state of the change task
  servicenow.itsm.change_request_task:
    state: in_progress
    on_hold: false
    number: CTASK0000001

- name: Close a change task
  servicenow.itsm.change_request_task:
    state: closed
    close_code: "successful"
    close_notes: "Closed"
    number: CTASK0000001

- name: Delete a change task
  servicenow.itsm.change_request_task:
    state: absent
    number: CTASK0000001

Authors

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

Collection links