python-jira-plus 1.0.11__tar.gz → 1.0.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-jira-plus
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary: Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.
5
5
  Home-page: https://github.com/aviz92/python-jira-plus
6
6
  Author: Avi Zaguri
@@ -51,8 +51,7 @@ class JiraPlus:
51
51
  self.jira_client = self.create_connection()
52
52
  self.check_client_connection()
53
53
 
54
- @retry(stop_max_attempt_number=3,
55
- wait_fixed=180000) # Retry 3 times with a 3-min (180000) delay between each attempt
54
+ @retry(stop_max_attempt_number=3, wait_fixed=180000)
56
55
  def create_connection(self, timeout=580) -> Optional[JIRA]:
57
56
  if self.server_type == ServerType.ON_PREMISE and not self.sso:
58
57
  jira_client = JIRA(
@@ -162,6 +161,9 @@ class JiraPlus:
162
161
  break
163
162
  retries = 0 # reset on success
164
163
  except JIRAError as err:
164
+ if err.status_code == 400:
165
+ self.logger.error(f"Bad Request: {err.text}")
166
+ raise JIRAError(f"Bad Request: {err.text}")
165
167
  retries += 1
166
168
  self.logger.warning(f"Retry {retries}/{jira_err_limit} after JIRAError: {err}")
167
169
  if retries >= jira_err_limit:
@@ -353,6 +355,10 @@ class JiraPlus:
353
355
  self.logger.exception(f"Unexpected error: {err}")
354
356
  return False
355
357
 
358
+ def add_comment(self, issue: str, comment: str) -> None:
359
+ self.jira_client.add_comment(issue=issue, body=comment)
360
+ self.logger.debug(f"Comment added to issue {issue} successfully.")
361
+
356
362
  def _get_available_link_types(self) -> set[str]:
357
363
  try:
358
364
  return {link_type.name for link_type in self.jira_client.issue_link_types()}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-jira-plus
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary: Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.
5
5
  Home-page: https://github.com/aviz92/python-jira-plus
6
6
  Author: Avi Zaguri
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- package_version = '1.0.11'
3
+ package_version = '1.0.13'
4
4
 
5
5
  package_name = 'python-jira-plus'
6
6
  package_description = 'Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.'