diff --git a/jira/client.py b/jira/client.py index 36dc2fea9..9c9195e62 100644 --- a/jira/client.py +++ b/jira/client.py @@ -2754,15 +2754,19 @@ def remove_watcher(self, issue: str | int, watcher: str) -> Response: return result @translate_resource_args - def worklogs(self, issue: str | int) -> list[Worklog]: + def worklogs(self, issue: str | int, expand: str | None = None) -> list[Worklog]: """Get a list of worklog Resources from the server for an issue. Args: issue (Union[str, int]): ID or key of the issue to get worklogs from + expand (Optional[str]): extra information to fetch inside each resource Returns: List[Worklog] """ - r_json = self._get_json("issue/" + str(issue) + "/worklog") + params = {} + if expand: + params["expand"] = expand + r_json = self._get_json("issue/" + str(issue) + "/worklog", params=params) worklogs = [ Worklog(self._options, self._session, raw_worklog_json) for raw_worklog_json in r_json["worklogs"] @@ -2770,17 +2774,18 @@ def worklogs(self, issue: str | int) -> list[Worklog]: return worklogs @translate_resource_args - def worklog(self, issue: str | int, id: str) -> Worklog: + def worklog(self, issue: str | int, id: str, expand: str | None = None) -> Worklog: """Get a specific worklog Resource from the server. Args: issue (Union[str, int]): ID or key of the issue to get the worklog from id (str): ID of the worklog to get + expand (Optional[str]): extra information to fetch inside each resource Returns: Worklog """ - return self._find_for_resource(Worklog, (issue, id)) + return self._find_for_resource(Worklog, (issue, id), expand=expand) @translate_resource_args def add_worklog(