Skip to content

Commit 11fbcdc

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
authored andcommitted
A few method for Bitbucket, Jira
1 parent 7f22c5c commit 11fbcdc

4 files changed

Lines changed: 50 additions & 1 deletion

File tree

CONTRIBUTING.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,24 @@ The following command builds a package and uploads it to PIP repository.
3030
::
3131

3232
python setup.py sdist upload
33+
34+
35+
References
36+
----------
37+
38+
1. Jira:
39+
https://docs.atlassian.com/software/jira/docs/api/REST/latest
40+
2. Confluence:
41+
https://developer.atlassian.com/server/confluence/confluence-server-rest-api/
42+
3. Jira Service Desk:
43+
https://developer.atlassian.com/cloud/jira/service-desk/rest/
44+
https://docs.atlassian.com/jira-servicedesk/REST/server
45+
4. Portfolio for Jira:
46+
47+
5. Bitbucket:
48+
https://developer.atlassian.com/server/bitbucket/reference/rest-api/
49+
https://developer.atlassian.com/server/bitbucket/how-tos/command-line-rest/
50+
6. Bamboo:
51+
52+
7. Tempo:
53+

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.3
1+
1.11.4

atlassian/bitbucket.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,26 @@ def get_changelog(self, project, repository, ref_from, ref_to, limit=99999):
259259
limit=limit)
260260
return (self.get(url) or {}).get('values')
261261

262+
def get_file_list(self, project, repository, query, limit=100000):
263+
"""
264+
Retrieve a page of files from particular directory of a repository.
265+
The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
266+
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
267+
:param project:
268+
:param repository:
269+
:param query: the commit ID or ref (e.g. a branch or tag) to list the files at.
270+
If not specified the default branch will be used instead.
271+
:param limit: OPTIONAL
272+
:return:
273+
"""
274+
url = "rest/api/1.0/projects/{project}/repos/{repository}/files?at={query}&limit={limit}".format(
275+
project=project,
276+
repository=repository,
277+
query=query,
278+
limit=limit)
279+
280+
return (self.get(url) or {}).get('values')
281+
262282
def get_content_of_file(self, project, repository, filename):
263283
"""
264284
Get raw content of the file from repo

atlassian/jira.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ def get_issue_status(self, issue_key):
347347
def component(self, component_id):
348348
return self.get('rest/api/2/component/{component_id}'.format(component_id=component_id))
349349

350+
def get_component_related_issues(self, component_id):
351+
"""
352+
Returns counts of issues related to this component.
353+
:param component_id:
354+
:return:
355+
"""
356+
return self.get("rest/api/2/component/{component_id}/relatedIssueCounts".format(component_id=component_id))
357+
350358
def create_component(self, component):
351359
log.warning('Creating component "{name}"'.format(name=component['name']))
352360
url = 'rest/api/2/component/'

0 commit comments

Comments
 (0)