From e6b19a230829864ec722b3fd8d5da8b8f11ea2a8 Mon Sep 17 00:00:00 2001 From: Lev Baranov Date: Wed, 16 Oct 2024 17:33:15 +0500 Subject: [PATCH 1/2] add additional parameters for add_worklog() --- jira/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jira/client.py b/jira/client.py index 36dc2fea9..9f182b9f3 100644 --- a/jira/client.py +++ b/jira/client.py @@ -2795,6 +2795,7 @@ def add_worklog( started: datetime.datetime | None = None, user: str | None = None, visibility: dict[str, Any] | None = None, + **additionalProperties ) -> Worklog: """Add a new worklog entry on an issue and return a Resource for it. @@ -2812,6 +2813,8 @@ def add_worklog( visibility (Optional[Dict[str,Any]]): Details about any restrictions in the visibility of the worklog. Example of visibility options when creating or updating a worklog. ``{ "type": "group", "value": "", "identifier": ""}`` + **additionalProperties: Extra properties of any type may be provided to this object. + https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-post-request-body Returns: Worklog @@ -2851,6 +2854,8 @@ def add_worklog( "active": False, } data["updateAuthor"] = data["author"] + if additionalProperties: + data.update(additionalProperties) # report bug to Atlassian: author and updateAuthor parameters are ignored. url = self._get_url(f"issue/{issue}/worklog") r = self._session.post(url, params=params, data=json.dumps(data)) From 2ec486b838a0d5f1e889df1a5f9effe45c975bc4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:13:29 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jira/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jira/client.py b/jira/client.py index 9f182b9f3..e71e42931 100644 --- a/jira/client.py +++ b/jira/client.py @@ -2795,7 +2795,7 @@ def add_worklog( started: datetime.datetime | None = None, user: str | None = None, visibility: dict[str, Any] | None = None, - **additionalProperties + **additionalProperties, ) -> Worklog: """Add a new worklog entry on an issue and return a Resource for it.