Skip to content

Commit f42b592

Browse files
committed
Update internal self.get_issue calls to fetch only necessary fields
1 parent 0a09708 commit f42b592

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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"]})
@@ -1833,7 +1833,7 @@ def scrap_regex_from_issue(self, issue: str, regex: str):
18331833
list: A list of matches.
18341834
"""
18351835
regex_output = []
1836-
issue_output = self.get_issue(issue)
1836+
issue_output = self.get_issue(issue, fields="description,comment")
18371837
description = issue_output["fields"]["description"]
18381838
comments = issue_output["fields"]["comment"]["comments"]
18391839

@@ -1903,7 +1903,7 @@ def get_issue_tree_recursive(self, issue_key: str, tree: Optional[list] = None,
19031903
# 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
19041904
if depth > 150:
19051905
raise Exception("Recursion depth exceeded")
1906-
issue = self.get_issue(issue_key)
1906+
issue = self.get_issue(issue_key, fields="issuelinks,subtasks")
19071907
issue_links = issue["fields"]["issuelinks"]
19081908
subtasks = issue["fields"]["subtasks"]
19091909
for issue_link in issue_links:
@@ -2056,7 +2056,7 @@ def set_issue_status(
20562056

20572057
def get_issue_status_changelog(self, issue_id: T_id):
20582058
# Get the issue details with changelog
2059-
response_get_issue = self.get_issue(issue_id, expand="changelog")
2059+
response_get_issue = self.get_issue(issue_id, fields="id", expand="changelog")
20602060
status_change_history = []
20612061
for history in response_get_issue["changelog"]["histories"]:
20622062
for item in history["items"]:

0 commit comments

Comments
 (0)