diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 791ae8e..f93fed1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/phantomcyber/dev-cicd-tools - rev: v1.22 + rev: v1.23 hooks: - id: org-hook - id: package-app-dependencies diff --git a/README.md b/README.md index 1e99b05..cf73409 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ [comment]: # "Auto-generated SOAR connector documentation" # PagerDuty -Publisher: Splunk -Connector Version: 2.0.7 +Publisher: Splunk Community +Connector Version: 3.0.0 Product Vendor: PagerDuty Product Name: PagerDuty Product Version Supported (regex): ".\*" -Minimum Product Version: 6.2.1 +Minimum Product Version: 6.2.2 This app integrates with PagerDuty to implement investigative and ticketing actions diff --git a/pagerduty.json b/pagerduty.json index dff2f50..db1d910 100644 --- a/pagerduty.json +++ b/pagerduty.json @@ -2,17 +2,17 @@ "appid": "932c09b3-e09d-40ff-a2b7-b090f7468c54", "name": "PagerDuty", "description": "This app integrates with PagerDuty to implement investigative and ticketing actions", - "publisher": "Splunk", + "publisher": "Splunk Community", "package_name": "phantom_pagerduty", "type": "ticketing", "license": "Copyright (c) 2016-2024 Splunk Inc.", "main_module": "pagerduty_connector.py", - "app_version": "2.0.7", + "app_version": "3.0.0", "utctime_updated": "2024-10-01T07:26:12.000000Z", "product_vendor": "PagerDuty", "product_name": "PagerDuty", "product_version_regex": ".*", - "min_phantom_version": "6.2.1", + "min_phantom_version": "6.2.2", "fips_compliant": true, "logo": "logo_pagerduty.svg", "logo_dark": "logo_pagerduty_dark.svg", diff --git a/pagerduty_connector.py b/pagerduty_connector.py index 27d82c9..101c96d 100644 --- a/pagerduty_connector.py +++ b/pagerduty_connector.py @@ -259,11 +259,13 @@ def _paginator(self, endpoint, action_result): def _handle_list_oncalls(self, param): # Add an action result to the App Run + self.debug_print("Running action - list oncalls") action_result = self.add_action_result(ActionResult(dict(param))) result_list = self._paginator("/oncalls?", action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list oncalls' failed") return action_result.get_status() for oncall in result_list: @@ -276,11 +278,13 @@ def _handle_list_oncalls(self, param): def _handle_list_teams(self, param): # Add an action result to the App Run + self.debug_print("Running action - list teams") action_result = self.add_action_result(ActionResult(dict(param))) result_list = self._paginator("/teams?", action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list teams' failed") return action_result.get_status() for team in result_list: @@ -293,6 +297,7 @@ def _handle_list_teams(self, param): def _handle_list_services(self, param): # Add an action result to the App Run + self.debug_print("Running action - list services") action_result = self.add_action_result(ActionResult(dict(param))) str_endpoint = "" @@ -311,6 +316,7 @@ def _handle_list_services(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list services' failed") return action_result.get_status() for service in result_list: @@ -323,6 +329,7 @@ def _handle_list_services(self, param): def _handle_list_users(self, param): # Add an action result to the App Run + self.debug_print("Running action - list users") action_result = self.add_action_result(ActionResult(dict(param))) str_endpoint = "" @@ -341,6 +348,7 @@ def _handle_list_users(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list users' failed") return action_result.get_status() for user in result_list: @@ -354,6 +362,7 @@ def _handle_list_escalations(self, param): # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) + self.debug_print("Running action - list escalations") str_endpoint = "" if param.get("team_ids"): @@ -382,6 +391,7 @@ def _handle_list_escalations(self, param): result_list = self._paginator(endpoint, action_result) if phantom.is_fail(result_list): + self.debug_print("Action 'list escalations' failed") return action_result.get_status() if result_list is None: @@ -397,6 +407,7 @@ def _handle_list_escalations(self, param): def _handle_create_incident(self, param): # Add an action result to the App Run + self.debug_print("Running action - create incident") action_result = self.add_action_result(ActionResult(dict(param))) body = { @@ -420,6 +431,7 @@ def _handle_create_incident(self, param): ret_val, resp_data = self._make_rest_call("/incidents", action_result, data=body, headers=headers, method="post") if phantom.is_fail(ret_val): + self.debug_print("Action 'create incident' failed") return action_result.get_status() action_result.add_data(resp_data) @@ -432,6 +444,7 @@ def _handle_get_oncall_user(self, param): # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) + self.debug_print("Running action - get oncall user") # Setup params params = {"escalation_policy_ids[]": param["escalation_id"]} @@ -455,6 +468,7 @@ def _handle_get_oncall_user(self, param): ret_val, resp_data_user = self._make_rest_call("/users/{0}".format(user_id), action_result, params={}) if phantom.is_fail(ret_val): + self.debug_print("Action 'get oncall users' failed") return action_result.get_status() user["user"] = resp_data_user.get("user") @@ -464,6 +478,7 @@ def _handle_get_oncall_user(self, param): def _handle_get_user_info(self, param): + self.debug_print("Running action - get user info") # Add an action result to the App Run action_result = self.add_action_result(ActionResult(dict(param))) @@ -472,6 +487,7 @@ def _handle_get_user_info(self, param): ret_val, resp_data = self._make_rest_call("/users/{0}".format(user_id), action_result, params={}) if phantom.is_fail(ret_val): + self.debug_print("Action 'get user info' failed") return action_result.get_status() try: diff --git a/pyproject.toml b/pyproject.toml index 474efd9..4c594fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,4 @@ verbose = true [tool.isort] line_length = 145 +profile = "black" diff --git a/release_notes/3.0.0.md b/release_notes/3.0.0.md new file mode 100644 index 0000000..8c5dddb --- /dev/null +++ b/release_notes/3.0.0.md @@ -0,0 +1 @@ +* De-certify and release as Splunk Community App[PAPP-34998] \ No newline at end of file diff --git a/tox.ini b/tox.ini index 2b96e78..720a141 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,4 @@ [flake8] max-line-length = 145 max-complexity = 28 -extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D - -[isort] -line_length = 145 +extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D,W503