Batch access to comments in RT REST 2.0 API


Looking at the REST 2.0 API, it looks like there’s no clean way to extract all comment content from a series of tickets. In the 1.0 API, there was the “long format” which allowed you to list all comments and their contents from a given ticket, which meant that for a given search, you had basically N+1 requests to make: one for the search, and one for each ticket: not bad.

Now with the new design, you need to make:

  1. one request for the search (1)
  2. one request per ticket (N+1)
  3. one request per transaction in the ticket (N*C+1)
  4. one request per attachment per transaction per ticket (ANC+1)

This is kind of a geometric explosion here and is quite slow… I see in the transactions endpoint that there’s a GET /transactions?query=<JSON> endpoint, but it’s not clear to me how that works… and there are no examples of transaction-specific JSON searches out there that I can find.