intercom-node icon indicating copy to clipboard operation
intercom-node copied to clipboard

ERROR | Unexpected error when using the `search` query on the `post` method

Open Neosoulink opened this issue 10 months ago • 1 comments

Version info

  • intercom-node version: ^5.0.0
  • Node version: v21.2.0

Expected behavior

Being able to retrieve the expected ticket using the search query with the query field ticket_attribute.{id}

Actual behavior

After several attempts, I'm not able to search a ticket using the client.post method. For some reason, when passing the ticket_attribute. plus a specific attribute (even the default one), I'm getting an error.

Steps to reproduce

After the installation, token configuration, and environment settings completed

  1. Requesting the ticket
import { Operators } from "intercom-client";

const tickets = await intercomClient.post({
    url: `${env.INTERCOM_API_BASE_URL}/tickets/search`,
    data: {
      query: {
        field: "ticket_attribute.id", // The `id` is a custom attribute created in the workspace
        operator: Operators.EQUALS,
        value: ATTRIBUTE_ID_VALUE, // The `ATTRIBUTE_ID_VALUE` is a UUID string generated in a previous operation
      },
    },
  });

Logs

Error: The requested ticket attribute ID is not a valid integer

=====

[
  {
    code: 'field_not_found',
    message: 'The requested ticket attribute ID is not a valid integer'
  }
]

Resources: https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Tickets/searchTickets/

Neosoulink avatar Apr 12 '24 12:04 Neosoulink

Same issue here

ritmillio avatar Apr 22 '24 15:04 ritmillio