Skip to content

Commit

Permalink
Add docs about properties (#1218)
Browse files Browse the repository at this point in the history
* Add docs about properties

* Simplify expression

* Jira: Add for changelog the pagination

---------

Co-authored-by: Gonchik Tsymzhitov <[email protected]>
  • Loading branch information
gonchik and gonchik authored Aug 16, 2023
1 parent 26112ff commit 0d74d1c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ def each(self, pagelen=10):
API docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-get
"""
params = {}
params["pagelen"] = pagelen
params = {"pagelen": pagelen}

response = super(BitbucketCloudBase, self).get(None, params=params)

Expand All @@ -190,7 +189,7 @@ def each(self, pagelen=10):

if pagelen_total < size_total:
pagelen_total = pagelen_total + response["pagelen"]
page = page + 1
page += 1
response = super(BitbucketCloudBase, self).get(None, params={"pagelen": pagelen, "page": page})
else:
break
Expand Down
13 changes: 10 additions & 3 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def set_property(self, property_id, value):

def get_advanced_settings(self):
"""
Returns the properties that are displayed on the "General Configuration > Advanced Settings" page
Returns the properties that are displayed on the "General Configuration > Advanced Settings" page.
:return:
"""
url = self.resource_url("application-properties/advanced-settings")
Expand Down Expand Up @@ -1077,15 +1077,22 @@ def issue_editmeta(self, key):
url = "{}/{}/editmeta".format(base_url, key)
return self.get(url)

def get_issue_changelog(self, issue_key):
def get_issue_changelog(self, issue_key, start=None, limit=None):
"""
Get issue related change log
:param issue_key:
:param start: start index, usually 0
:param limit: limit of the results, usually 50
:return:
"""
base_url = self.resource_url("issue")
url = "{base_url}/{issue_key}?expand=changelog".format(base_url=base_url, issue_key=issue_key)
return (self.get(url) or {}).get("changelog")
params = {}
if start:
params["startAt"] = start
if limit:
params["maxResults"] = limit
return (self.get(url) or {}).get("changelog", params)

def issue_add_json_worklog(self, key, worklog):
"""
Expand Down
25 changes: 25 additions & 0 deletions docs/jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ Reindex Jira
If it's not possible (due to an inconsistent index), do a foreground reindexing.
"""
Manage Permissions
------------------

.. code-block:: python
# Get permissions
jira.permissions(permissions, project_id=None, project_key=None, issue_id=None, issue_key=None,)
# Get all permissions
jira.get_all_permissions()
Application properties
----------------------

.. code-block:: python
# Get an application property
jira.get_property(key=None, permission_level=None, key_filter=None)
# Set an application property
jira.set_property(property_id, value)
# Returns the properties that are displayed on the "General Configuration > Advanced Settings" page.
jira.get_advanced_settings()
Manage users
------------

Expand Down

0 comments on commit 0d74d1c

Please sign in to comment.