-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get a count of total records retrieved by the filter_tickets Method #56
Comments
Hi, |
I have just noticed we can only return the first 10 pages of tickets with the API. Is this the limitation you're running up against? |
Yes, the API is limited to 10 pages with at most 30 records, so 300 in total. However the I'd love to use your library, but would want to run a request first, see if there are more than 300 records and then split this request in to several requests with on of several dimension values. Ie. query by priority, date, status, assigned user, ... If I make a request for each possible permutation I hit several thousand requests and this would run for nearly an hour (and until I get rate limited/or even blacklisted). So I want to check the record count for a less restrictive query first and only create the more restrictive one if I'm exceeding the limit of 300 tickets. |
Ok, that makes sense. You're welcome to fork if you want, however I've got an idea that would both implement what you are needing easily while maintaining backwards compatibility with the existing filter. I'll report back soon. |
I'll check this on my tomorrow and can then fork or leave it to you. Thanks for this great library and support. |
Maybe to comment on one point here though, your query paginates automatically and that's triggering many requests which may not be needed (because the result can be incomplete) it would be useful if we can turn pagination off and get only a single record when retrieving the total number of records. |
I agree, that was part of what I was thinking. Good catch! |
Apologies - I have been flat out and haven't had a chance yet 😄 |
As a developer I would like to know the total count of tickets returned by a query_string so that I know if I cannot retrieve all the tickets in the query.
Hi Sam I really like this project and hope to use it quite a bit. But sadly you are shielding this fairly critical indicator in your implementation of
filter_tickets
.My preferred implementation would be to simply have a method called
total_records(self, query, **kwargs)
which retrieve only one page but would get the total of records.I'd be happy to fork and contribute this if you would like me to.
The text was updated successfully, but these errors were encountered: