From 6f58b704c08d12925f217b686ca1da57726fa120 Mon Sep 17 00:00:00 2001 From: Amanda Bizzinotto Date: Thu, 29 Jun 2023 08:36:39 -0300 Subject: [PATCH] Use user_id when adding watcher (#1682) --- jira/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jira/client.py b/jira/client.py index 9a090c701..7cc71033a 100644 --- a/jira/client.py +++ b/jira/client.py @@ -2342,7 +2342,9 @@ def add_watcher(self, issue: str | int, watcher: str) -> Response: Response """ url = self._get_url("issue/" + str(issue) + "/watchers") - return self._session.post(url, data=json.dumps(watcher)) + # Use user_id when adding watcher + watcher_id = self._get_user_id(watcher) + return self._session.post(url, data=json.dumps(watcher_id)) @translate_resource_args def remove_watcher(self, issue: str | int, watcher: str) -> Response: