Skip to content

Commit

Permalink
add visibility argument
Browse files Browse the repository at this point in the history
  • Loading branch information
adehad committed Dec 21, 2023
1 parent a01fc15 commit b5935a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,7 @@ def add_worklog(
comment: (str | None) = None,
started: (datetime.datetime | None) = None,
user: (str | None) = None,
visibility: (Dict[str, Any] | None) = None,
) -> Worklog:
"""Add a new worklog entry on an issue and return a Resource for it.
Expand All @@ -2418,6 +2419,15 @@ def add_worklog(
comment (Optional[str]): optional worklog comment
started (Optional[datetime.datetime]): Moment when the work is logged, if not specified will default to now
user (Optional[str]): the user ID or name to use for this worklog
visibility (Optional[Dict[str,Any]]): Details about any restrictions in the visibility of the worklog.
Optional when creating or updating a worklog. ::
```js
{
"type": "group", # "group" or "role"
"value": "<string>",
"identifier": "<string>" # OPTIONAL
}
```
Returns:
Worklog
Expand All @@ -2441,6 +2451,8 @@ def add_worklog(
# we log user inside comment as it doesn't always work
data["comment"] = user

if visibility is not None:
data["visibility"] = visibility
if started is not None:
# based on REST Browser it needs: "2014-06-03T08:21:01.273+0000"
if started.tzinfo is None:
Expand Down

0 comments on commit b5935a7

Please sign in to comment.