Coverage for plugins/module_utils/problem.py : 73%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# -*- coding: utf-8 -*- # Copyright: (c) 2021, XLAB Steampunk <steampunk@xlab.si> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
(NEW, "new"), (ASSESS, "assess"), (RCA, "root_cause_analysis"), (FIX, "fix_in_progress"), (RESOLVED, "resolved"), (CLOSED, "closed"), ]
impact=[("1", "high"), ("2", "medium"), ("3", "low")], urgency=[("1", "high"), ("2", "medium"), ("3", "low")], problem_state=STATE_MAPPING, state=STATE_MAPPING, )
"assigned_to", "resolution_code", "short_description", "fix_notes", "cause_notes", "close_notes", "duplicate_of", ]
self.client = client self.base_api_path = re.sub(r"/+", "/", "/{0}/".format(base_api_path))
new_state = data["state"] path = "{0}{1}/new_state/{2}".format( self.base_api_path, problem_number, new_state )
# Fields filtering is a restriction enforced by the store application. # State updates are only allowed with certain fields. filtered_data = filter_dict(data, *ALLOWED_FIELDS)
return self.client.patch( path, filtered_data, query=dict(sysparm_exclude_reference_link=True) ).json["result"] |