Skip to content

Commit 9c7aca6

Browse files
authored
Jira: Update assign_issue to match the current API (atlassian-api#795)
* Jira: Update assign_issue to match the current API * Jira: Document assign_issue in markdown docs
1 parent f76298c commit 9c7aca6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

atlassian/jira.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -963,17 +963,17 @@ def issue_add_watcher(self, issue_key, user):
963963
data=data,
964964
)
965965

966-
def assign_issue(self, issue, assignee=None):
966+
def assign_issue(self, issue, account_id=None):
967967
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
968968
:param issue: the issue ID or key to assign
969969
:type issue: int or str
970-
:param assignee: the user to assign the issue to
971-
:type assignee: str
970+
:param account_id: the account ID of the user to assign the issue to
971+
:type account_id: str
972972
:rtype: bool
973973
"""
974974
base_url = self.resource_url("issue")
975975
url = "{base_url}/{issue}/assignee".format(base_url=base_url, issue=issue)
976-
data = {"name": assignee}
976+
data = {"accountId": account_id}
977977
return self.put(url, data=data)
978978

979979
def create_issue(self, fields, update_history=False, update=None):

docs/jira.rst

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ Manage issues
168168
# Update issue
169169
jira.issue_update(issue_key, fields)
170170
171+
# Assign issue to user
172+
jira.assign_issue(issue_key, account_id)
173+
171174
# Create issue
172175
jira.issue_create(fields)
173176

0 commit comments

Comments
 (0)