From f42b592085b9911f025b9a056fed89af640a4592 Mon Sep 17 00:00:00 2001 From: jerubball Date: Thu, 12 Mar 2026 13:50:01 -0400 Subject: [PATCH] Update internal self.get_issue calls to fetch only necessary fields --- atlassian/jira.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atlassian/jira.py b/atlassian/jira.py index 963427d5c..9731db517 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -239,7 +239,7 @@ def get_attachments_ids_from_issue(self, issue: T_id) -> List[Dict[str, str]]: :param issue: str : jira issue key :return: list of integers attachment IDs """ - issue_id = self.get_issue(issue)["fields"]["attachment"] + issue_id = self.get_issue(issue, fields="attachment")["fields"]["attachment"] list_attachments_id = [] for attachment in issue_id: list_attachments_id.append({"filename": attachment["filename"], "attachment_id": attachment["id"]}) @@ -1833,7 +1833,7 @@ def scrap_regex_from_issue(self, issue: str, regex: str): list: A list of matches. """ regex_output = [] - issue_output = self.get_issue(issue) + issue_output = self.get_issue(issue, fields="description,comment") description = issue_output["fields"]["description"] comments = issue_output["fields"]["comment"]["comments"] @@ -1903,7 +1903,7 @@ def get_issue_tree_recursive(self, issue_key: str, tree: Optional[list] = None, # Check the recursion depth. In case of any bugs that would result in infinite recursion, this will prevent the function from crashing your app. Python default for REcursionError is 1000 if depth > 150: raise Exception("Recursion depth exceeded") - issue = self.get_issue(issue_key) + issue = self.get_issue(issue_key, fields="issuelinks,subtasks") issue_links = issue["fields"]["issuelinks"] subtasks = issue["fields"]["subtasks"] for issue_link in issue_links: @@ -2056,7 +2056,7 @@ def set_issue_status( def get_issue_status_changelog(self, issue_id: T_id): # Get the issue details with changelog - response_get_issue = self.get_issue(issue_id, expand="changelog") + response_get_issue = self.get_issue(issue_id, fields="id", expand="changelog") status_change_history = [] for history in response_get_issue["changelog"]["histories"]: for item in history["items"]: