Skip to content

Add function for getting watchers #890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,15 @@ def issue_delete_watcher(self, issue_key, user):
data=data,
)

def issue_get_watchers(self, issue_key):
"""
Get watchers for an issue
:param issue_key: Issue Id or Key
:return: List of watchers for issue
"""
base_url = self.resource_url("issue")
return self.get("{base_url}/{issue_key}/watchers".format(base_url=base_url, issue_key=issue_key))

def assign_issue(self, issue, account_id=None):
"""Assign an issue to a user. None will set it to unassigned. -1 will set it to Automatic.
:param issue: the issue ID or key to assign
Expand Down
3 changes: 3 additions & 0 deletions docs/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ Manage issues
# Remove watcher from an issue
jira.issue_delete_watcher(issue_key, user)

# Get watchers for an issue
jira.issue_get_watchers(issue_key)


Manage Boards
-------------
Expand Down