Skip to content

Commit 87e0fb0

Browse files
authored
Merge pull request atlassian-api#289 from SLRover/master
Added: get issue security schemes methods, docs icon
2 parents f92d3f4 + 8216393 commit 87e0fb0

File tree

5 files changed

+82
-6
lines changed

5 files changed

+82
-6
lines changed

README.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
============================
22
Atlassian Python API wrapper
33
============================
4-
|Build Status| |PyPI version| |PyPI - Downloads| |License| |Codacy Badge|
4+
|Build Status| |PyPI version| |PyPI - Downloads| |License| |Codacy Badge| |Docs|
55

66
Documentation
77
-------------
88

9-
`Documentation (beta)`_
9+
`Documentation`_
1010

11-
.. _Documentation (beta): https://atlassian-python-api.readthedocs.io/en/latest/index.html
11+
.. _Documentation: https://atlassian-python-api.readthedocs.io/en/latest/index.html
1212

1313
Examples
1414
--------
@@ -109,6 +109,9 @@ See the `Contribution guidelines for this project`_ for details on how to make c
109109
:alt: Codacy Badge
110110
.. |PyPI - Downloads| image:: https://pepy.tech/badge/atlassian-python-api/month
111111
:alt: PyPI - Downloads
112+
.. |Docs| image:: https://readthedocs.org/projects/atlassian-python-api/badge/?version=latest
113+
:target: https://atlassian-python-api.readthedocs.io/en/latest/?badge=latest
114+
:alt: Documentation Status
112115

113116

114117
Credits

atlassian/jira.py

+47
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,53 @@ def set_permissionscheme_grant(self, permission_id, new_permission):
13151315

13161316
return self.post(url, data=new_permission)
13171317

1318+
def get_issue_security_schemes(self):
1319+
"""
1320+
Returns all issue security schemes that are defined
1321+
Administrator permission required
1322+
1323+
:return: list
1324+
"""
1325+
url = 'rest/api/2/issuesecurityschemes'
1326+
1327+
return self.get(url).get('issueSecuritySchemes')
1328+
1329+
def get_issue_security_scheme(self, scheme_id, only_levels=False):
1330+
"""
1331+
Returns the issue security scheme along with that are defined
1332+
1333+
Returned if the user has the administrator permission or if the scheme is used in a project in which the
1334+
user has the administrative permission
1335+
1336+
:param scheme_id: int
1337+
:param only_levels: bool
1338+
:return: list
1339+
"""
1340+
url = 'rest/api/2/issuesecurityschemes/{}'.format(scheme_id)
1341+
1342+
if only_levels is True:
1343+
return self.get(url).get('levels')
1344+
else:
1345+
return self.get(url)
1346+
1347+
def get_project_issue_security_scheme(self, project_id_or_key, only_levels=False):
1348+
"""
1349+
Returns the issue security scheme for project
1350+
1351+
Returned if the user has the administrator permission or if the scheme is used in a project in which the
1352+
user has the administrative permission
1353+
1354+
:param project_id_or_key: int
1355+
:param only_levels: bool
1356+
:return: list
1357+
"""
1358+
url = 'rest/api/2/project/{}/issuesecuritylevelscheme'.format(project_id_or_key)
1359+
1360+
if only_levels is True:
1361+
return self.get(url).get('levels')
1362+
else:
1363+
return self.get(url)
1364+
13181365
"""
13191366
#######################################################################
13201367
# Tempo Account REST API implements #

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '1.11.7'
29+
release = '1.13.23'
3030

3131
# -- General configuration ---------------------------------------------------
3232

docs/index.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Welcome to Atlassian Python API's documentation!
77
================================================
8-
|Build Status| |PyPI version| |License| |Codacy Badge|
8+
|Build Status| |PyPI version| |PyPI - Downloads| |License| |Codacy Badge| |Docs|
99

1010
Getting started
1111
---------------
@@ -88,4 +88,9 @@ Alternatively OAuth can be used:
8888
:alt: License
8989
.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/c822908f507544fe98ae37b25518ae3d
9090
:target: https://www.codacy.com/project/gonchik/atlassian-python-api/dashboard?utm_source=github.com&utm_medium=referral&utm_content=AstroMatt/atlassian-python-api&utm_campaign=Badge_Grade_Dashboard
91-
:alt: Codacy Badge
91+
:alt: Codacy Badge
92+
.. |PyPI - Downloads| image:: https://pepy.tech/badge/atlassian-python-api/month
93+
:alt: PyPI - Downloads
94+
.. |Docs| image:: https://readthedocs.org/projects/atlassian-python-api/badge/?version=latest
95+
:target: https://atlassian-python-api.readthedocs.io/en/latest/?badge=latest
96+
:alt: Documentation Status

docs/jira.rst

+21
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ Manage projects
125125
# Use 'expand' to get details (default is None)
126126
jira.get_project_permission_scheme(project_id_or_key, expand='permissions,user,group,projectRole,field,all')
127127
128+
# Get the issue security scheme for project.
129+
# Returned if the user has the administrator permission or if the scheme is used in a project in which the
130+
# user has the administrative permission.
131+
# Use only_levels=True for get the only levels entries
132+
jira.get_project_issue_security_scheme(project_id_or_key, only_levels=False)
133+
134+
128135
Manage issues
129136
-------------
130137

@@ -251,3 +258,17 @@ Issue link types
251258
# Update issue link type
252259
jira.update_issue_link_type(issue_link_type_id, data):
253260
261+
Issue security schemes
262+
----------------------
263+
.. code-block:: python
264+
265+
# Get all security schemes.
266+
# Returned if the user has the administrator permission or if the scheme is used in a project in which the
267+
# user has the administrative permission.
268+
jira.get_issue_security_schemes()
269+
270+
# Get issue security scheme.
271+
# Returned if the user has the administrator permission or if the scheme is used in a project in which the
272+
# user has the administrative permission.
273+
# Use only_levels=True for get the only levels entries
274+
jira.get_issue_security_scheme(scheme_id, only_levels=False)

0 commit comments

Comments
 (0)