5 min read

Zendesklisttickets

Purpose

This node is designed to interface with the Zendesk API to retrieve a list of support tickets based on specific criteria. This function enables integrations that require data about customer service tickets for analysis, reporting, or decision-making purposes. Users can specify various parameters like ticket status, number of tickets to fetch per page, sorting by specific attributes, and order of sorting, facilitating a customizable query to extract relevant ticket information.

Settings

The zendeskListTickets component accepts a number of settings that determine how the logic retrieves tickets. Below are the detailed settings:

Status

  1. Setting Name: status
  2. Input Type: String
  3. Description: This parameter defines the current status of the tickets to be fetched. Acceptable values include "open", "pending", "solved", and "closed". Changing this value impacts which tickets are retrieved; for example, setting it to "closed" would return only the tickets that have been resolved.
  4. Default Value: 'open'

Per Page

  1. Setting Name: per_page
  2. Input Type: Numeric
  3. Description: This setting specifies the maximum number of tickets to return per page. Modifying this value will change the volume of data fetched in one API call. A higher number may be useful for comprehensive views, whereas a lower number can streamline processing for large datasets.
  4. Default Value: 10

Sort By

  1. Setting Name: sort_by
  2. Input Type: String
  3. Description: This parameter indicates the attribute by which the tickets should be sorted. Possible options include fields such as "created_at", "updated_at", "priority", etc. Changing this value alters how the tickets are ordered in the output, making the data more relevant for various analytical purposes.
  4. Default Value: 'updated_at'

Sort Order

  1. Setting Name: sort_order
  2. Input Type: String
  3. Description: This setting allows the user to specify the order of the sorting results—either "asc" for ascending or "desc" for descending order. Altering this value will determine whether the results are displayed from oldest to newest or vice versa.
  4. Default Value: 'desc'

Page

  1. Setting Name: page
  2. Input Type: Numeric (inferred)
  3. Description: Although this setting is not explicitly defined as an input to the function, it can be specified in the parameters to navigate through paginated results. Changing this value will fetch the corresponding page of ticket results, allowing for iterative scrolling through the entire list.
  4. Default Value: Not explicitly defined; defaults to 1 in the meta output.

How It Works

  1. Integration Setup: An instance of the Zendesk connection is created using a secure connection which facilitates secure API connection handling.

  2. Parameter Construction: The function constructs params based on user inputs or default settings. It also filters out any parameters with null or undefined values, ensuring only valid parameters are included in the API call.

  3. Ticket Retrieval: The constructed parameters are then passed to the listTickets method of the Zendesk integration instance, which performs the API call to fetch the tickets.

  4. Output Formatting: After receiving the response, it formats the data into a consistent structure containing the fetched tickets, count, pagination details (like next_page and previous_page), and meta information for the returned ticket data.

  5. Error Handling: If any errors occur during the execution, it catches the exception and logs the error message, returning a user-friendly error response.

Data Expectations

The function expects the following data structure as inputs:

Use Cases & Examples

Use Case 1: Customer Support Dashboard

A business wants to build a real-time customer support dashboard that displays the status of open tickets to manage workload and response time effectively. By utilizing the nodeality, the support team can obtain the most critical information about tickets currently requiring attention.

Use Case 2: Monthly Ticket Analysis

A data analyst is responsible for producing reports that assess trends in ticket resolution times. They want to gather tickets closed in the last month, sorted by their resolution times, to analyze performance and resource allocation.

Example Configuration

For the monthly ticket analysis use case, the analyst could configure this node with the following parameters:

javascript
const inputs = {
  status: 'closed',         // To fetch only tickets that are resolved
  per_page: 50,            // To get a broader set of data at once
  sort_by: 'resolved_at',   // Assuming 'resolved_at' is a valid sort option
  sort_order: 'asc',       // To view the earliest resolved tickets first
};

const result = await zendeskListTickets({ inputs });

This configuration allows the analyst to effectively analyze the tickets closed in chronological order, facilitating better insights into the team's performance during that month.

Billing Impacts

Utilizing this node may have billing implications based on the number of API calls made and the volume of data processed. Each API call to Zendesk may be subject to usage limits, impacting how many tickets can be retrieved in a given timeframe. Thus, proper configuration and understanding of these limits are essential to avoid unexpected charges or throttling.