Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional parameters for add_worklog() #1905

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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": "<string>", "identifier": "<string>"}``
**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
Expand Down Expand Up @@ -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))
Expand Down
Loading