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
.
New in servicenow.itsm 1.0.0
- Create, delete or update a ServiceNow problem.
- For more information, refer to the ServiceNow problem management documentation at https://docs.servicenow.com/bundle/tokyo-it-service-management/page/product/problem-management/concept/c_ProblemManagement.html.
Parameter |
Comments |
|
---|---|---|
assigned_to string |
A person who will assess this problem. Expected value for assigned_to is user id (usually in the form of This field is required when creating new problems for all problem states except |
|
attachments list / elements=dictionary added in servicenow.itsm 1.2.0 |
ServiceNow attachments. |
|
name string |
Name of the file to be uploaded. Serves as unique identifier. If not specified, the module will use path's base name. |
|
path string / required |
Path to the file to be uploaded. |
|
type string |
MIME type of the file to be attached. If not specified, the module will try to guess the file's type from its extension. |
|
base_api_path string added in servicenow.itsm 2.0.0 |
Base API path for the ServiceNow problem state management scripted API. Used for managing problem state transitions. Requires API for Red Hat Ansible Automation Platform Certified Content Collection application to be installed from the ServiceNow Store https://store.servicenow.com/sn_appstore_store.do#!/store/application/9b33c83a1bcc5510b76a0d0fdc4bcb21/1.0.0?sl=sh. Considered mostly for development and testing purposes, as in most cases the default value should be fine. Starting with release Rome, ServiceNow Table API no longer supports problem state transitions, which is worked around by using this server-side scripted REST API resource. Default: |
|
cause_notes string |
Provide information on what caused the problem. Required if state is Required if state is |
|
close_notes string |
The reason for closing the problem. Required if state is |
|
description string |
Detailed description of the problem. |
|
duplicate_of string |
Number of the problem of which this problem is a duplicate of. Required if state is |
|
fix_notes string |
Notes on how the problem was fixed. Required if state is Required if state is |
|
impact string |
Effect that the problem has on business. Default choices are |
|
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 |
|
api_path string added in servicenow.itsm 2.4.0 |
Change the API endpoint of SNOW instance from default 'api/now'. Default: |
|
client_id string |
ID of the client application used for OAuth authentication. If not set, the value of the 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 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 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:
|
|
host string / required |
The ServiceNow host name. If not set, the value of the |
|
password string |
Password used for authentication. If not set, the value of the 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 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 |
|
username string |
Username used for authentication. If not set, the value of the 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:
|
|
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 documentation on creating problems at https://docs.servicenow.com/bundle/tokyo-it-service-management/page/product/problem-management/task/create-a-problem-v2.html. |
|
problem_mapping dictionary added in servicenow.itsm 1.3.0 |
User mapping for Problem object, where user can override Choice Lists values for objects. |
|
impact dictionary |
Effect that the problem has on business. |
|
problem_state dictionary |
State of the problem. If a problem does not yet exist, all states except for This mapping can also be edited inside Choice Lists inside ServiceNow and can differ from state mapping. |
|
state dictionary |
State of the problem. If a problem does not yet exist, all states except for Special value that can not be overridden is |
|
urgency dictionary |
The extent to which the problem resolution can bear delay. |
|
resolution_code string |
The reason for problem resolution. Choices:
|
|
short_description string |
Short description of the problem that the problem-solving team should address. Required if the problem does not exist yet. |
|
state string |
State of the problem. If a problem does not yet exist, all states except for Default choices are |
|
sys_id string |
Unique identifier of the record to operate on. |
|
urgency string |
The extent to which the problem resolution can bear delay. Default choices are |
-
List ServiceNow problems.
-
Manage ServiceNow problem tasks.
servicenow.itsm.problem_task_info
List ServiceNow problem tasks.
- name: Create a problem
servicenow.itsm.problem:
state: new
short_description: Issue with the network printer
description: Since this morning, all printer jobs are stuck.
attachments:
- path: path/to/attachment.txt
impact: medium
urgency: low
other:
user_input: notes
- name: Assign a problem to a user for assessment
servicenow.itsm.problem:
number: PRB0000010
state: assess
assigned_to: problem.manager
- name: Mark a problem for root cause analysis
servicenow.itsm.problem:
number: PRB0000010
state: root_cause_analysis
- name: Work on fixing a problem
servicenow.itsm.problem:
number: PRB0000010
state: fix_in_progress
cause_notes: I identified the issue.
fix_notes: Fix here.
- name: Close a problem as fixed
servicenow.itsm.problem:
number: PRB0000010
state: closed
resolution_code: fix_applied
cause_notes: I found that this doesn't work.
fix_notes: I solved it like this.
- name: Close a problem as duplicate
servicenow.itsm.problem:
number: PRB0000010
state: closed
resolution_code: duplicate
duplicate_of: PRB0000001
- name: Cancel a problem
servicenow.itsm.problem:
number: PRB0000010
state: closed
resolution_code: canceled
close_notes: The problem seems to have resolved itself.
- name: Delete a problem
servicenow.itsm.problem:
number: PRB0000010
state: absent
The following are the fields unique to this module:
- Manca Bizjak (@mancabizjak)
- Miha Dolinar (@mdolin)
- Tadej Borovsak (@tadeboro)
- Matej Pevec (@mysteriouswolf)
- Uros Pascinski (@uscinski)