Freshdesk Get Tickets by Requester ID with Filters

This function retrieves Freshdesk tickets for a specific requester ID with comprehensive filtering capabilities. The function supports filtering by status, priority, tags, dates, and custom fields, with both inclusion and exclusion options.

Action Inputs

Required Parameters

NameTypeDescription
domainCredentialsThe Freshdesk subdomain (e.g., if URL is 'company.freshdesk.com', enter 'company')
keyCredentialsYour Freshdesk API key
requester_idStringThe Freshdesk requester ID to fetch tickets for

Optional Parameters

NameTypeDescription
filtersObjectObject containing filter criteria (see Filters section)
return_fieldsArrayList of ticket fields to include in the response

Action Outputs

NameTypeDescription
successBooleanWhether the request was successful
totalNumberTotal number of tickets found
contactObjectContact details for the requester
ticketsArrayList of tickets matching the filter criteria

Filter Object Properties

The filter object supports the following properties:

Status Filters

  • status: Comma-separated list of statuses to include
  • exclude_status: Comma-separated list of statuses to exclude

Available status values:

  • Open (2)
  • Pending (3)
  • Resolved (4)
  • Closed (5)
  • Waiting on Customer (6)
  • Waiting on Third Party (7)

Priority Filters

  • priority: Comma-separated list of priorities to include
  • exclude_priority: Comma-separated list of priorities to exclude

Available priority values:

  • Low (1)
  • Medium (2)
  • High (3)
  • Urgent (4)

Tag Filters

  • tags: Comma-separated list of tags to include
  • exclude_tags: Comma-separated list of tags to exclude

Date Filters

  • created_after: Include tickets created after this date (YYYY-MM-DD)
  • created_before: Include tickets created before this date (YYYY-MM-DD)
  • updated_after: Include tickets updated after this date (YYYY-MM-DD)
  • updated_before: Include tickets updated before this date (YYYY-MM-DD)

Text Search Filters

  • subject_contains: Comma-separated list of strings to search for in subject
  • description_contains: Comma-separated list of strings to search for in description

Custom Field Filters

  • custom_fields: Object of custom fields to filter by
  • exclude_custom_fields: Object of custom fields to exclude

ID Exclusion

  • exclude_id: Single ticket ID or comma-separated list of ticket IDs to exclude

Usage Examples

Basic Usage (No Filters)

const event = {
    domain: "company",
    key: "your_api_key",
    requester_id: "3043074593490"
};

Comprehensive Filter Example

const event = {
    domain: "company",
    key: "your_api_key",
    requester_id: "3043074593490",
    filters: {
        status: "Open,Pending",
        exclude_status: "Closed",
        priority: "High,Urgent",
        exclude_priority: "Low",
        tags: "eBay,UK",
        exclude_tags: "Spam,Duplicate",
        created_after: "2024-01-01",
        created_before: "2024-03-31",
        subject_contains: "Order,Payment",
        description_contains: "refund,tracking",
        custom_fields: {
            cf_channel: "UK",
            cf_product_type: "Books"
        },
        exclude_custom_fields: {
            cf_automated_response: true
        },
        exclude_id: "12500376,12500377"
    },
    return_fields: [
        "id",
        "subject",
        "status",
        "priority",
        "created_at",
        "updated_at",
        "tags",
        "custom_fields",
        "description_text"
    ]
};

Default Return Fields

If no return_fields are specified, the function returns these fields by default:

  • id
  • subject
  • status
  • priority
  • created_at
  • updated_at
  • tags
  • custom_fields
  • description_text

Notes

  1. All text searches (subject_contains, description_contains) are case-insensitive
  2. Date filters should be in YYYY-MM-DD format
  3. Custom field filtering requires exact matches
  4. Tag filtering is case-insensitive
  5. When both inclusion and exclusion filters are provided for the same field type, exclusions are processed first