Skip to content

Commit 29945d7

Browse files
authored
Add account list to request participant methods (#1256)
* Add account list to request participant methods * Changed from list to None for request participants
1 parent 4440183 commit 29945d7

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

atlassian/service_desk.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_request_participants(self, issue_id_or_key, start=0, limit=50):
187187
return response
188188
return (response or {}).get("values")
189189

190-
def add_request_participants(self, issue_id_or_key, users_list):
190+
def add_request_participants(self, issue_id_or_key, users_list=None, account_list=None):
191191
"""
192192
Add users as participants to an existing customer request
193193
The calling user must have permission to manage participants for this customer request
@@ -197,11 +197,15 @@ def add_request_participants(self, issue_id_or_key, users_list):
197197
:return:
198198
"""
199199
url = "rest/servicedeskapi/request/{}/participant".format(issue_id_or_key)
200-
data = {"usernames": users_list}
200+
data = {}
201+
if users_list is not None:
202+
data["usernames"] = users_list
203+
if account_list is not None:
204+
data["accountIds"] = account_list
201205

202206
return self.post(url, data=data, headers=self.experimental_headers)
203207

204-
def remove_request_participants(self, issue_id_or_key, users_list):
208+
def remove_request_participants(self, issue_id_or_key, users_list=None, account_list=None):
205209
"""
206210
Remove participants from an existing customer request
207211
The calling user must have permission to manage participants for this customer request
@@ -211,7 +215,11 @@ def remove_request_participants(self, issue_id_or_key, users_list):
211215
:return:
212216
"""
213217
url = "rest/servicedeskapi/request/{}/participant".format(issue_id_or_key)
214-
data = {"usernames": users_list}
218+
data = {}
219+
if users_list is not None:
220+
data["usernames"] = users_list
221+
if account_list is not None:
222+
data["accountIds"] = account_list
215223

216224
return self.delete(url, data=data, headers=self.experimental_headers)
217225

docs/service_desk.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ Manage a Participants
6060
6161
# Add request participants
6262
# The calling user must have permission to manage participants for this customer request
63-
sd.add_request_participants(issue_id_or_key, users_list)
63+
sd.add_request_participants(issue_id_or_key, users_list=None, account_list=None)
6464
6565
# Remove request participants
6666
# The calling user must have permission to manage participants for this customer request
67-
sd.remove_request_participants(issue_id_or_key, users_list)
67+
sd.remove_request_participants(issue_id_or_key, users_list=None, account_list=None)
6868
6969
Transitions
7070
-----------

0 commit comments

Comments
 (0)