Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions atlassian/service_desk.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,42 @@ def get_request_types(self, service_desk_id):
f"rest/servicedeskapi/servicedesk/{service_desk_id}/requesttype",
headers=self.experimental_headers,
)
def get_request_type(self, service_desk_id, request_type_id):
"""
Fetches detailed information about a specific request type within a service desk.

:param service_desk_id: The ID of the service desk where the request type
exists.
:type service_desk_id: str
:param request_type_id: The ID of the request type to retrieve.
:type request_type_id: str
:return: A dictionary containing the details of the specified request type.
:rtype: dict
"""
return self.get(
f"rest/servicedeskapi/servicedesk/{service_desk_id}/requesttype/{request_type_id}",
headers=self.experimental_headers,
)

def get_request_type_fields(self, service_desk_id, request_type_id):
"""
Retrieve the fields for a specific request type in a service desk.

:param service_desk_id: The ID of the service desk for which the request type
fields are to be retrieved.
:type service_desk_id: str
:param request_type_id: The ID of the request type within the specified service
desk.
:type request_type_id: str
:return: A response object containing the fields information for the specified
request type.
:rtype: requests.Response
"""

return self.get(
f"rest/servicedeskapi/servicedesk/{service_desk_id}/requesttype/{request_type_id}/field",
headers=self.experimental_headers,
)

# Participants actions
def get_request_participants(self, issue_id_or_key, start=0, limit=50):
Expand Down
18 changes: 17 additions & 1 deletion docs/service_desk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,24 @@ Manage a Participants
# The calling user must have permission to manage participants for this customer request
sd.remove_request_participants(issue_id_or_key, users_list=None, account_list=None)


Request types
---------------------

.. code-block:: python

# Get all request types in a serrvice desk project
sd.get_request_types(service_desk_id)

# Get single request type in a given serrvice desk project
sd.get_request_type(service_desk_id, request_type_id)

# Get field composition of a given request type
sd.get_request_type_fields(service_desk_id, request_type_id)


Transitions
-----------
---------------------

**EXPERIMENTAL** (may change without notice)

Expand Down
Loading