Skip to content

Commit d02241a

Browse files
committed
Jira: add accountID for issue delete watcher method #1501
1 parent fe06ba4 commit d02241a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

atlassian/jira.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,16 +1525,20 @@ def issue_add_watcher(self, issue_key, user):
15251525
data=data,
15261526
)
15271527

1528-
def issue_delete_watcher(self, issue_key, user):
1528+
def issue_delete_watcher(self, issue_key, user=None, account_id=None):
15291529
"""
15301530
Stop watching issue
15311531
:param issue_key:
15321532
:param user:
15331533
:return:
15341534
"""
15351535
log.info('Deleting user %s from "%s" watchers', user, issue_key)
1536-
params = {"username": user}
15371536
base_url = self.resource_url("issue")
1537+
params = {}
1538+
if self.cloud:
1539+
params = {"accountId": account_id}
1540+
else:
1541+
params = {"username": user}
15381542
return self.delete(
15391543
f"{base_url}/{issue_key}/watchers",
15401544
params=params,
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
from atlassian import Confluence
22
import os
33

4-
confluence_datacenter = Confluence(
5-
url='confl_server_url',
6-
token='<api_token>'
7-
)
4+
confluence_datacenter = Confluence(url="confl_server_url", token="<api_token>")
85

96

107
def download_attachments_test(api_wrapper_object, page_id, directory_path):
@@ -14,8 +11,8 @@ def download_attachments_test(api_wrapper_object, page_id, directory_path):
1411
def check_file_size(directory):
1512
for filename in os.listdir(directory):
1613
if os.path.isfile(os.path.join(directory, filename)):
17-
print(f'File: {filename}, Size: {os.path.getsize(os.path.join(directory, filename))} bytes')
14+
print(f"File: {filename}, Size: {os.path.getsize(os.path.join(directory, filename))} bytes")
1815

1916

20-
download_attachments_test(confluence_datacenter, 393464, '~/Downloads/confluence_attachments')
21-
check_file_size('~/Downloads/confluence_attachments')
17+
download_attachments_test(confluence_datacenter, 393464, "~/Downloads/confluence_attachments")
18+
check_file_size("~/Downloads/confluence_attachments")

0 commit comments

Comments
 (0)