Skip to content

Commit 0d74d1c

Browse files
authored
Add docs about properties (#1218)
* Add docs about properties * Simplify expression * Jira: Add for changelog the pagination --------- Co-authored-by: Gonchik Tsymzhitov <gonchik.tsymzhitov@atlassiancommunity.com>
1 parent 26112ff commit 0d74d1c

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ def each(self, pagelen=10):
170170
171171
API docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-get
172172
"""
173-
params = {}
174-
params["pagelen"] = pagelen
173+
params = {"pagelen": pagelen}
175174

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

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

191190
if pagelen_total < size_total:
192191
pagelen_total = pagelen_total + response["pagelen"]
193-
page = page + 1
192+
page += 1
194193
response = super(BitbucketCloudBase, self).get(None, params={"pagelen": pagelen, "page": page})
195194
else:
196195
break

atlassian/jira.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def set_property(self, property_id, value):
128128

129129
def get_advanced_settings(self):
130130
"""
131-
Returns the properties that are displayed on the "General Configuration > Advanced Settings" page
131+
Returns the properties that are displayed on the "General Configuration > Advanced Settings" page.
132132
:return:
133133
"""
134134
url = self.resource_url("application-properties/advanced-settings")
@@ -1077,15 +1077,22 @@ def issue_editmeta(self, key):
10771077
url = "{}/{}/editmeta".format(base_url, key)
10781078
return self.get(url)
10791079

1080-
def get_issue_changelog(self, issue_key):
1080+
def get_issue_changelog(self, issue_key, start=None, limit=None):
10811081
"""
10821082
Get issue related change log
10831083
:param issue_key:
1084+
:param start: start index, usually 0
1085+
:param limit: limit of the results, usually 50
10841086
:return:
10851087
"""
10861088
base_url = self.resource_url("issue")
10871089
url = "{base_url}/{issue_key}?expand=changelog".format(base_url=base_url, issue_key=issue_key)
1088-
return (self.get(url) or {}).get("changelog")
1090+
params = {}
1091+
if start:
1092+
params["startAt"] = start
1093+
if limit:
1094+
params["maxResults"] = limit
1095+
return (self.get(url) or {}).get("changelog", params)
10891096

10901097
def issue_add_json_worklog(self, key, worklog):
10911098
"""

docs/jira.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,31 @@ Reindex Jira
3131
If it's not possible (due to an inconsistent index), do a foreground reindexing.
3232
"""
3333
34+
Manage Permissions
35+
------------------
36+
37+
.. code-block:: python
38+
39+
# Get permissions
40+
jira.permissions(permissions, project_id=None, project_key=None, issue_id=None, issue_key=None,)
41+
42+
# Get all permissions
43+
jira.get_all_permissions()
44+
45+
Application properties
46+
----------------------
47+
48+
.. code-block:: python
49+
50+
# Get an application property
51+
jira.get_property(key=None, permission_level=None, key_filter=None)
52+
53+
# Set an application property
54+
jira.set_property(property_id, value)
55+
56+
# Returns the properties that are displayed on the "General Configuration > Advanced Settings" page.
57+
jira.get_advanced_settings()
58+
3459
Manage users
3560
------------
3661

0 commit comments

Comments
 (0)