From 1659978173e4d9157d9c7d22db4b4cf46fa32b08 Mon Sep 17 00:00:00 2001 From: Prince Date: Mon, 6 Dec 2021 21:49:20 +0100 Subject: [PATCH 1/2] update to v0.4.8 * Added two new methods for JSM API --- jiraone/access.py | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/jiraone/access.py b/jiraone/access.py index b2329237..ab9cf38e 100644 --- a/jiraone/access.py +++ b/jiraone/access.py @@ -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) @@ -791,6 +791,7 @@ def create_organization(cls): :request POST: :body param: name, datatype -> string + """ return "{}/rest/servicedeskapi/organization".format(LOGIN.base_url) @@ -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. @@ -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. @@ -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 From b6a532aea1b184c7868fefeb04b9334d762805d6 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 21 Dec 2021 12:51:49 +0000 Subject: [PATCH 2/2] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7ff0c0b3..208a90ef 100644 --- a/setup.py +++ b/setup.py @@ -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 "