FreshserviceClient
Attributes
TRIGGER_OPERATIONS
module-attribute
TRIGGER_OPERATIONS: Dict[str, Dict[str, Any]] = {'OnTicketCreatedV2': {'operation_id': 'OnTicketCreatedV2', 'path': '/{connectionId}/trigger/api/v2/tickets', 'method': 'get', 'required_parameters': [], 'callback_payload_type': 'ListTicketResponse'}}
Classes
AddNoteResponse
dataclass
Response for Add a note to a ticket
CreateUpdateTicketResponse
dataclass
Response for Create a ticket
ListTicketResponse
dataclass
ListTicketResponse(*, created_at: Optional[str] = None, department_id: Optional[int] = None, due_by: Optional[str] = None, group_id: Optional[int] = None, id: Optional[int] = None, is_escalated: Optional[bool] = None, priority: Optional[int] = None, requester_id: Optional[int] = None, responder_id: Optional[int] = None, source: Optional[int] = None, spam: Optional[bool] = None, status: Optional[int] = None, subject: Optional[str] = None, type_: Optional[str] = None, updated_at: Optional[str] = None, description_text: Optional[str] = None, description: Optional[str] = None, to_emails: Optional[List[str]] = None)
Response for When a ticket is created
Attributes
created_at
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
due_by
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
group_id
class-attribute
instance-attribute
Id of Group to which the ticket is assigned.
id
class-attribute
instance-attribute
Unique Id of the ticket.
is_escalated
class-attribute
instance-attribute
Set to true if an escalation was sent.
priority
class-attribute
instance-attribute
A number representing the priority of the ticket.
requester_id
class-attribute
instance-attribute
User-id of the requester. For existing contacts, requester_id can be passed instead of email.
responder_id
class-attribute
instance-attribute
Id of the agent to whom the ticket is assigned.
source
class-attribute
instance-attribute
A number representing the channel through which the ticket was created.
spam
class-attribute
instance-attribute
Set as true if the ticket is marked as spam.
status
class-attribute
instance-attribute
A number representing the status of the ticket.
subject
class-attribute
instance-attribute
Ticket subject.
type_
class-attribute
instance-attribute
Type property field as defined in ticket fields.
updated_at
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
description_text
class-attribute
instance-attribute
Description of the problem.
description
class-attribute
instance-attribute
HTML content of the ticket. Description and description_html should not be passed together.
CreateTicketRequest
dataclass
CreateTicketRequest(subject: str, status: str, priority: str, description: str, *, requester_id: Optional[int] = None, email: Optional[str] = None, phone: Optional[str] = None, name: Optional[str] = None, urgency: Optional[str] = None, impact: Optional[str] = None, source: Optional[str] = None)
Definition: CreateTicket_Request
Attributes
requester_id
class-attribute
instance-attribute
User-id of the requester. One of the Requester ID, Requester Email and Requester Phone is required
email
class-attribute
instance-attribute
Email of the requester. One of the Requester ID, Requester Email and Requester Phone is required
phone
class-attribute
instance-attribute
Phone number of the requester. One of the Requester ID, Requester Email and Requester Phone is required
name
class-attribute
instance-attribute
Name of the requester. This is a required field only if Requester Phone value is provided
priority
instance-attribute
The priority of the ticket (such as Low, Medium, or High).
urgency
class-attribute
instance-attribute
Urgency of the problem (such as Low, Medium or High).
impact
class-attribute
instance-attribute
Impact of the problem (such as Low, Medium or High).
UpdateTicketRequest
dataclass
UpdateTicketRequest(*, requester_id: Optional[int] = None, subject: Optional[str] = None, status: Optional[str] = None, priority: Optional[str] = None, urgency: Optional[str] = None, impact: Optional[str] = None, source: Optional[str] = None)
Definition: UpdateTicket_Request
Attributes
requester_id
class-attribute
instance-attribute
User-id of the requester. For existing contacts, requester_id can be passed instead of email.
subject
class-attribute
instance-attribute
The subject of the ticket.
status
class-attribute
instance-attribute
Status of the ticket.
priority
class-attribute
instance-attribute
The priority of the ticket (such as Low, Medium, or High).
urgency
class-attribute
instance-attribute
Urgency of the problem (such as Low, Medium or High).
impact
class-attribute
instance-attribute
Impact of the problem (such as Low, Medium or High).
AddNoteRequest
dataclass
TicketResponse
dataclass
TicketResponse(*, created_at: Optional[str] = None, deleted: Optional[bool] = None, department_id_value: Optional[int] = None, display_id: Optional[int] = None, due_by: Optional[str] = None, group_id: Optional[int] = None, id: Optional[int] = None, impact: Optional[int] = None, isescalated: Optional[bool] = None, owner_id: Optional[str] = None, priority: Optional[int] = None, requester_id: Optional[int] = None, responder_id: Optional[int] = None, source: Optional[int] = None, spam: Optional[bool] = None, status: Optional[int] = None, subject: Optional[str] = None, ticket_type: Optional[str] = None, to_email: Optional[str] = None, updated_at: Optional[str] = None, urgency: Optional[int] = None, description: Optional[str] = None, description_html: Optional[str] = None, status_name: Optional[str] = None, priority_name: Optional[str] = None, source_name: Optional[str] = None, responder_name: Optional[str] = None, to_emails: Optional[List[str]] = None, department_name: Optional[str] = None, assoc_problem_id: Optional[int] = None, assoc_change_id: Optional[int] = None, assoc_change_cause_id: Optional[int] = None, assoc_asset_id: Optional[int] = None, urgency_name: Optional[str] = None, impact_name: Optional[str] = None)
Definition: Ticket_Response
Attributes
created_at
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
deleted
class-attribute
instance-attribute
Set as true if the ticket is deleted/trashed. Deleted tickets will not be considered in any views except 'deleted' filter.
display_id
class-attribute
instance-attribute
Ticket Id specific to your account.
due_by
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
group_id
class-attribute
instance-attribute
Id of Group to which the ticket is assigned.
id
class-attribute
instance-attribute
Unique Id of the ticket.
impact
class-attribute
instance-attribute
A number representing the impact of the problem.
isescalated
class-attribute
instance-attribute
Set to true if an escalation was sent.
owner_id
class-attribute
instance-attribute
Id of the agent to whom the problem is assigned.
priority
class-attribute
instance-attribute
A number representing the priority of the ticket.
requester_id
class-attribute
instance-attribute
User-id of the requester. For existing contacts, requester_id can be passed instead of email.
responder_id
class-attribute
instance-attribute
Id of the agent to whom the ticket is assigned.
source
class-attribute
instance-attribute
A number representing the channel through which the ticket was created.
spam
class-attribute
instance-attribute
Set as true if the ticket is marked as spam.
status
class-attribute
instance-attribute
A number representing the status of the ticket.
subject
class-attribute
instance-attribute
Ticket subject.
ticket_type
class-attribute
instance-attribute
Type property field as defined in ticket fields.
to_email
class-attribute
instance-attribute
Email address to which the incoming ticket email was sent.
updated_at
class-attribute
instance-attribute
yyyy-MM-ddTHH:mm:ss.fffZ
urgency
class-attribute
instance-attribute
A number representing the urgency of the problem.
description
class-attribute
instance-attribute
Description of the problem.
description_html
class-attribute
instance-attribute
HTML content of the ticket. Description and description_html should not be passed together.
status_name
class-attribute
instance-attribute
Status of the ticket.
priority_name
class-attribute
instance-attribute
Priority of the ticket.
source_name
class-attribute
instance-attribute
The channel through which the ticket was created.
responder_name
class-attribute
instance-attribute
Name of the agent to whom the ticket is assigned.
to_emails
class-attribute
instance-attribute
Email addresses to which the incoming ticket email was sent.
department_name
class-attribute
instance-attribute
Name of the department.
assoc_problem_id
class-attribute
instance-attribute
Id of the associated problem to the ticket.
assoc_change_id
class-attribute
instance-attribute
Id of the associated change to the problem.
assoc_change_cause_id
class-attribute
instance-attribute
Id of the change causing the ticket.
assoc_asset_id
class-attribute
instance-attribute
Id of the asset associated to the ticket.
urgency_name
class-attribute
instance-attribute
Urgency of the problem.
UpdateTicketResponse
dataclass
Definition: UpdateTicket_Response
FreshserviceClient
FreshserviceClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)
Bases: ConnectorClientBase
Typed client for freshservice connector.
Initialize a FreshserviceClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_runtime_url
|
str
|
The connection runtime URL from Azure Portal. |
required |
credential
|
AsyncTokenCredential | AzureKeyCredential
|
Caller-owned Azure Core credential. |
required |
max_retry_attempts
|
int
|
The maximum number of request attempts. |
3
|
timeout
|
float
|
The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines. |
30.0
|
use_exponential_backoff
|
bool
|
Whether retries use exponential backoff. |
True
|
initial_retry_delay_seconds
|
float
|
The initial retry delay in seconds. |
0.5
|
maximum_retry_delay_seconds
|
float
|
The maximum retry delay in seconds. |
120.0
|
retry_jitter_factor
|
float
|
The jitter fraction applied to retry delays. |
0.1
|
retry_unsafe_http_methods
|
bool
|
Whether unsafe HTTP methods may be retried. |
False
|
transport
|
Optional[AsyncHttpTransport]
|
Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle. |
None
|
**kwargs
|
Any
|
Optional Azure Core pipeline policy settings. |
{}
|
Methods:
add_note
async
add_note(input: AddNoteRequest | Mapping[str, Any], ticket_id: int, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Add a note to a ticket
Add a private or public note to a ticket.
Swagger operation ID: AddNoteV2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
AddNoteRequest | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
ticket_id
|
int
|
The ticket id to update. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
create_ticket
async
create_ticket(input: CreateTicketRequest | Mapping[str, Any], *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Create a ticket
Create a ticket.
Swagger operation ID: CreateTicketV2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateTicketRequest | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
update_ticket
async
update_ticket(input: UpdateTicketRequest | Mapping[str, Any], ticket_id: int, *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Update a ticket
Update a ticket (only specified values will be updated).
Swagger operation ID: UpdateTicketV2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
UpdateTicketRequest | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
ticket_id
|
int
|
The ticket id to update. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |