Skip to content

Commit

Permalink
Add project_securitylevels method
Browse files Browse the repository at this point in the history
This adds a method to retrieve the project/{}/securitylevel endpoint.

Signed-off-by: Patrick Talbert <[email protected]>
  • Loading branch information
ptalbert committed Nov 8, 2024
1 parent ef10e1a commit 3cbf45e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3365,6 +3365,23 @@ def project_components(self, project: str) -> list[Component]:
]
return components

@translate_resource_args
def project_securitylevels(self, project: str | int) -> list[SecurityLevel]:
"""Get a list of securitylevel Resources for the current user on a project.
Args:
project (Union[str, int]): ID or key of the project to get securitylevels of
Returns:
List[SecurityLevel]
"""
r_json = self._get_json("project/" + str(project) + "/securitylevel")
security_levels = [
SecurityLevel(self._options, self._session, raw_securitylevel_json)
for raw_securitylevel_json in r_json["levels"]
]
return security_levels

@translate_resource_args
def project_versions(self, project: str) -> list[Version]:
"""Get a list of version Resources present on a project.
Expand Down

0 comments on commit 3cbf45e

Please sign in to comment.