Skip to content

Commit 5728cfa

Browse files
authored
Update internal self.get_issue calls to fetch only necessary fields (#1621)
1 parent 1e1e24a commit 5728cfa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

atlassian/jira.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def get_attachments_ids_from_issue(self, issue: T_id) -> List[Dict[str, str]]:
239239
:param issue: str : jira issue key
240240
:return: list of integers attachment IDs
241241
"""
242-
issue_id = self.get_issue(issue)["fields"]["attachment"]
242+
issue_id = self.get_issue(issue, fields="attachment")["fields"]["attachment"]
243243
list_attachments_id = []
244244
for attachment in issue_id:
245245
list_attachments_id.append({"filename": attachment["filename"], "attachment_id": attachment["id"]})
@@ -1895,7 +1895,7 @@ def scrap_regex_from_issue(self, issue: str, regex: str):
18951895
list: A list of matches.
18961896
"""
18971897
regex_output = []
1898-
issue_output = self.get_issue(issue)
1898+
issue_output = self.get_issue(issue, fields="description,comment")
18991899
description = issue_output["fields"]["description"]
19001900
comments = issue_output["fields"]["comment"]["comments"]
19011901

@@ -1965,7 +1965,7 @@ def get_issue_tree_recursive(self, issue_key: str, tree: Optional[list] = None,
19651965
# 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
19661966
if depth > 150:
19671967
raise Exception("Recursion depth exceeded")
1968-
issue = self.get_issue(issue_key)
1968+
issue = self.get_issue(issue_key, fields="issuelinks,subtasks")
19691969
issue_links = issue["fields"]["issuelinks"]
19701970
subtasks = issue["fields"]["subtasks"]
19711971
for issue_link in issue_links:
@@ -2118,7 +2118,7 @@ def set_issue_status(
21182118

21192119
def get_issue_status_changelog(self, issue_id: T_id):
21202120
# Get the issue details with changelog
2121-
response_get_issue = self.get_issue(issue_id, expand="changelog")
2121+
response_get_issue = self.get_issue(issue_id, fields="id", expand="changelog")
21222122
status_change_history = []
21232123
for history in response_get_issue["changelog"]["histories"]:
21242124
for item in history["items"]:

0 commit comments

Comments
 (0)