Skip to content

Latest commit

 

History

History
647 lines (587 loc) · 28.4 KB

servicenow.itsm.problem_task_module.rst

File metadata and controls

647 lines (587 loc) · 28.4 KB

servicenow.itsm.problem_task module -- Manage ServiceNow problem 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.problem_task.

New in servicenow.itsm 1.3.0

Parameter

Comments

assigned_to

string

Specific problem analyst to whom the task is assigned to.

assignment_group

string

Specific group to whom the problem task is assigned to.

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:

  • "completed"

  • "canceled"

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

Configuration item (CI) that the problem applies to. The CI class of the selected configuration item identifies the type of problem.

description

string

Detailed description of the problem task.

due_date

string

Date within which the problem task should be completed.

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.

other

dictionary

Optional remaining parameters.

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

priority

string

How quickly the service desk should address the problem task.

Default choices are critical, high, moderate, low, planning. One can override them by setting problem_task_mapping.priority.

problem_task_mapping

dictionary

added in servicenow.itsm 1.3.0

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

priority

dictionary

How quickly the service desk should address the problem task.

state

dictionary

State of problem tasks.

If state value is new, short_description parameter must be filled in.

short_description

string

Brief description of the problem task.

source_problem

string

Number of the problem for which the problem task is created.

state

string

State of problem tasks.

If state value is new, short_description parameter must be filled in.

Default choices are new, assess, work_in_progress, closed, absent. One can override them by setting problem_task_mapping.state.

sys_id

string

Unique identifier of the record to operate on.

type

string

Read-only state. Determines whether the problem task is created specifically to investigate the cause of the problem or is a general task.

Choices:

  • "root_cause_analysis"

  • "general"

- name: Create problem task
  servicenow.itsm.problem_task:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: new
    type: general
    source_problem: PRB0000001
    short_description: User is not receiving email
    description: User has been unable to receive email for the past 15 minutes
    priority: low

- name: Change state of the problem task
  servicenow.itsm.problem_task:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    number: PTASK0010005
    state: assess
    assigned_to: fred.luddy

- name: Close problem task
  servicenow.itsm.problem_task:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: closed
    number: PTASK0010005
    close_code: canceled
    close_notes: Closed

- name: Delete problem task
  servicenow.itsm.problem_task:
    instance:
      host: https://instance_id.service-now.com
      username: user
      password: pass

    state: absent
    number: PTASK0010005

The following are the fields unique to this module:

Key

Description

record

dictionary

A list of problem records.

Returned: success

Sample: {"active": "true", "activity_due": "", "additional_assignee_list": "", "approval": "not requested", "calendar_duration": "", "cause_code": "", "cause_notes": "", "close_code": "", "close_notes": "", "closed_at": "", "closed_by": "", "cmdb_ci": "26da329f0a0a0bb400f69d8159bc753d", "comments": "", "comments_and_work_notes": "", "company": "", "contact_type": "", "contract": "", "correlation_display": "", "correlation_id": "", "delivery_plan": "", "delivery_task": "", "description": "", "due_date": "", "escalation": "0", "expected_start": "", "fix_notes": "", "follow_up": "", "group_list": "", "impact": "low", "knowledge": "false", "location": "", "made_sla": "true", "number": "PTASK0010005", "opened_at": "2020-12-17 10:21:49", "opened_by": "d3dbbf173b331300ad3cc9bb34efc466", "order": "", "other_reason": "", "parent": "", "priority": "2", "problem": "d7296d02c0a801670085e737da016e70", "problem_task_type": "rca", "reassignment_count": "0", "reopen_count": "1", "reopened_at": "2020-12-17 10:23:10", "reopened_by": "6816f79cc0a8016401c5a33be04be441", "route_reason": "", "service_offering": "", "short_description": "SAP outage, please investigate the cause", "sla_due": "", "started_at": "2020-12-17 10:23:14", "started_by": "6816f79cc0a8016401c5a33be04be441", "state": "154", "sys_class_name": "problem_task", "sys_created_by": "admin", "sys_created_on": "2020-12-17 10:22:25", "sys_domain": "global", "sys_domain_path": "/", "sys_id": "5f6bec57531063004247ddeeff7b1216", "sys_mod_count": "5", "sys_tags": "", "sys_updated_by": "admin", "sys_updated_on": "2020-12-17 10:27:14", "task_effective_number": "PTASK0010005", "time_worked": "", "tranquilitybusiness_service": "", "universal_request": "", "upon_approval": "proceed", "upon_reject": "cancel", "urgency": "low", "user_input": "", "vendor": "", "watch_list": "", "work_end": "", "work_notes": "", "work_notes_list": "", "work_start": "", "workaround": ""}

Authors

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

Collection links