Skip to content

Commit c695760

Browse files
authored
Add function for getting watchers (atlassian-api#890)
Provides code and documentation for getting watchers for an issue.
1 parent 8914cb8 commit c695760

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

atlassian/jira.py

+9
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,15 @@ def issue_delete_watcher(self, issue_key, user):
978978
data=data,
979979
)
980980

981+
def issue_get_watchers(self, issue_key):
982+
"""
983+
Get watchers for an issue
984+
:param issue_key: Issue Id or Key
985+
:return: List of watchers for issue
986+
"""
987+
base_url = self.resource_url("issue")
988+
return self.get("{base_url}/{issue_key}/watchers".format(base_url=base_url, issue_key=issue_key))
989+
981990
def assign_issue(self, issue, account_id=None):
982991
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
983992
:param issue: the issue ID or key to assign

docs/jira.rst

+3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ Manage issues
239239
# Remove watcher from an issue
240240
jira.issue_delete_watcher(issue_key, user)
241241
242+
# Get watchers for an issue
243+
jira.issue_get_watchers(issue_key)
244+
242245
243246
Manage Boards
244247
-------------

0 commit comments

Comments
 (0)