Skip to content

Commit f86e269

Browse files
djachkovgonchik
authored andcommitted
Bitbucket: add get_users; add example; add to documentation (#429)
1 parent 3e7a2e6 commit f86e269

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

atlassian/bitbucket.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,3 +1657,9 @@ def get_lfs_repo_status(self, project_key, repo):
16571657
projectKey=project_key,
16581658
repositorySlug=repo)
16591659
return self.get(url)
1660+
1661+
def get_users(self, user_filter=None):
1662+
url = "/rest/api/1.0/users"
1663+
if user_filter:
1664+
url += "?filter={}".format(user_filter)
1665+
return self.get(url)

docs/bitbucket.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Groups and admins
100100
# All project administrators
101101
bitbucket.all_project_administrators()
102102
103+
# Get users. Use 'user_filter' parameter to get specific users.
104+
bitbucket.get_users(user_filter="username")
105+
103106
Manage code
104107
-----------
105108

examples/bitbucket-users.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# coding=utf-8
2+
from atlassian import Bitbucket
3+
4+
5+
bitbucket = Bitbucket(
6+
url='http://localhost:7990',
7+
username='admin',
8+
password='admin')
9+
10+
data = bitbucket.get_users(user_filter="username")
11+
print(data)

0 commit comments

Comments
 (0)