From 51c78545279b79633126df698e6fec5e2c885f9c Mon Sep 17 00:00:00 2001 From: vg-svitla Date: Tue, 7 Jan 2025 11:51:43 +0400 Subject: [PATCH 1/3] Fix: Jira add detailed error message --- JIRA/CHANGELOG.md | 6 ++++++ JIRA/jira_modules/action_base.py | 4 ++++ JIRA/manifest.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/JIRA/CHANGELOG.md b/JIRA/CHANGELOG.md index f2fb15802..2a26cdb2e 100644 --- a/JIRA/CHANGELOG.md +++ b/JIRA/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 2025-01-06 - 1.3.0 + +### Changed + +- Add details to error message in case of Jira API error + ## 2024-05-28 - 1.2.0 ### Changed diff --git a/JIRA/jira_modules/action_base.py b/JIRA/jira_modules/action_base.py index d90ef7a03..b07a23b9e 100644 --- a/JIRA/jira_modules/action_base.py +++ b/JIRA/jira_modules/action_base.py @@ -55,6 +55,10 @@ def get_paginated_results(self, path: str, result_field: str | None = "values") def _handle_response_error(self, response: requests.Response): if not response.ok: message = f"Request to JIRA API failed with status {response.status_code} - {response.reason}" + if response.status_code == 400: + data = response.json() + detailed_errors = data.get("errorMessages", [response.text]) + message = f"{message}: \n {','.join(detailed_errors)}" self.log(message=message, level="error") response.raise_for_status() diff --git a/JIRA/manifest.json b/JIRA/manifest.json index d9fd4e986..21528a33f 100644 --- a/JIRA/manifest.json +++ b/JIRA/manifest.json @@ -2,7 +2,7 @@ "uuid": "d1445e5e-8e3b-417f-ae19-bca67a10affd", "name": "Atlassian JIRA", "slug": "atlassian-jira", - "version": "1.2.0", + "version": "1.3.0", "description": "Integrates with JIRA", "configuration": { "title": "JIRA", From 4119e7cd0a00f9bf090c06256f40969981349135 Mon Sep 17 00:00:00 2001 From: vg-svitla Date: Tue, 7 Jan 2025 12:01:21 +0400 Subject: [PATCH 2/3] Fix pipeline --- JIRA/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/JIRA/pyproject.toml b/JIRA/pyproject.toml index b3d558a17..12c3f498d 100644 --- a/JIRA/pyproject.toml +++ b/JIRA/pyproject.toml @@ -3,6 +3,7 @@ name = "Automation Module for JIRA" description = "" version = "0.1" authors = [] +package-mode = false [tool.poetry.dependencies] python = ">=3.10,<3.12" From 2000d273f06ae41b2c641f3144c531510b86a304 Mon Sep 17 00:00:00 2001 From: vg-svitla Date: Tue, 7 Jan 2025 12:02:46 +0400 Subject: [PATCH 3/3] Rollback --- JIRA/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/JIRA/pyproject.toml b/JIRA/pyproject.toml index 12c3f498d..b3d558a17 100644 --- a/JIRA/pyproject.toml +++ b/JIRA/pyproject.toml @@ -3,7 +3,6 @@ name = "Automation Module for JIRA" description = "" version = "0.1" authors = [] -package-mode = false [tool.poetry.dependencies] python = ">=3.10,<3.12"