Skip to content

Commit

Permalink
Merge pull request #62 from princenyeche/princenyeche-patch-1
Browse files Browse the repository at this point in the history
update to v0.4.8
  • Loading branch information
princenyeche authored Dec 21, 2021
2 parents 8027652 + b6a532a commit 78aaeda
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
37 changes: 33 additions & 4 deletions jiraone/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def get_organizations(cls, start: int = 0, limit: int = 50, account_id: str = No
:param account_id, datatype string. e.g. 5b10ac8d82e05b22cc7d4ef5
"""
if account_id is not None:
return "{}/rest/servicedeskapi/organization?{}&start={}&limit={}" \
return "{}/rest/servicedeskapi/organization?accountId={}&start={}&limit={}" \
.format(LOGIN.base_url, account_id, start, limit)
else:
return "{}/rest/servicedeskapi/organization?start={}&limit={}".format(LOGIN.base_url, start, limit)
Expand All @@ -791,6 +791,7 @@ def create_organization(cls):
:request POST:
:body param: name, datatype -> string
"""
return "{}/rest/servicedeskapi/organization".format(LOGIN.base_url)

Expand All @@ -801,10 +802,38 @@ def get_organization(cls, org_id):
Use this method to get organization details whenever your application component is passed an organization ID
but needs to display other organization details.
:param org_id required
:param org_id: required
"""
return "{}/rest/servicedeskapi/organization/{}".format(LOGIN.base_url, org_id)

@classmethod
def get_service_desks(cls, start: int = 0, limit: int = 100) -> str:
"""This method returns all the service desks in the Jira Service Management
instance that the user has permission to access. Use this method where you need a list of service
desks or need to locate a service desk by name or keyword.
:param start: integer - pagination row
:param limit: integer - limit to each pagination
:return: string
"""
return "{}/rest/servicedeskapi/servicedesk?start={}&limit={}".format(LOGIN.base_url, start, limit)

@classmethod
def get_sd_by_id(cls, service_desk_id) -> str:
"""
This method returns a service desk. Use this method to get service desk details whenever your
application component is passed a service desk ID but needs to display other service desk details.
:param service_desk_id: The ID of the service desk to return. Required
:return: string
"""
return "{}/rest/servicedeskapi/servicedesk/{}".format(LOGIN.base_url, service_desk_id)

@classmethod
def delete_organization(cls, org_id):
"""This method deletes an organization.
Expand Down Expand Up @@ -907,7 +936,9 @@ def remove_sd_organization(cls, service_desk_id):
"""
return "{}/rest/servicedeskapi/servicedesk/{}/organization".format(LOGIN.base_url, service_desk_id)

############################################
# SERVICEDESK -> API specific to servicedesk
############################################
@classmethod
def get_customers(cls, service_desk_id, start: int = 0, limit: int = 50, query: str = None):
"""This method returns a list of the customers on a service desk.
Expand Down Expand Up @@ -1891,8 +1922,6 @@ def extract_issue_field_options(key_or_id: Union[str, int] = None, search: Dict
:param amend datatype[String] available option "add" or "remove" condition to decide action for appending.
:param data datatype[string] our object data that will be processed.
:return List of values
"""
collect = []
field_type = False if "customType" not in search else True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="jiraone",
version="0.4.7",
version="0.4.8",
author="Prince Nyeche",
author_email="support@elfapp.website",
description="A REST API Implementation to Jira Cloud APIs for creating reports and "
Expand Down

0 comments on commit 78aaeda

Please # to comment.