Skip to content

Commit 0ac1f63

Browse files
authored
Find users who have access to a project to browse (#1022)
Find users who have access to browse issues in a project. Supplying a username=" " will return all the users who have browse permission to a project.
1 parent 249a9a8 commit 0ac1f63

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

atlassian/jira.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,37 @@ def remove_user_from_group(self, username, group_name):
785785
params = {"groupname": group_name, "username": username}
786786

787787
return self.delete(url, params=params)
788+
789+
790+
def get_users_with_browse_permission_to_a_project(self, username, issue_key=None, project_key=None,
791+
start=0, limit=100):
792+
"""
793+
Returns a list of active users that match the search string. This resource cannot be accessed anonymously
794+
and requires the Browse Users global permission. Given an issue key this resource will provide a list of users
795+
that match the search string and have the browse issue permission for the issue provided.
796+
797+
:param: username:
798+
:param: issueKey:
799+
:param: projectKey:
800+
:param: startAt: OPTIONAL
801+
:param: maxResults: OPTIONAL
802+
:return: List of active users who has browser permission for the given project_key or issue_key
803+
"""
804+
url = self.resource_url("user/viewissue/search")
805+
params = {}
806+
if username:
807+
params["username"] = username
808+
if issue_key:
809+
params["issueKey"] = issue_key
810+
if project_key:
811+
params["projectKey"] = project_key
812+
if start:
813+
params["startAt"] = start
814+
if limit:
815+
params["maxResults"] = limit
816+
817+
return self.get(url, params=params)
818+
788819

789820
"""
790821
Issue

0 commit comments

Comments
 (0)