-
Notifications
You must be signed in to change notification settings - Fork 119
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
project.issues does not return all issues #45
Comments
Some more details: The kwargs dict in Redmine.request seems to hold the right values. kwargs just before calling: response = getattr(requests, method)(url, **kwargs). |
Hi! I can't reproduce it here. Are you using a real Redmine or some fork like ChiliProject ? I'm asking because the problem you described exists exactly in ChiliProject fork. If you are using a real Redmine, can you also reproduce this problem if you issue a raw request to the API through your browser directly, like http://your-redmine-url/projects/your-project/issues.json?limit=100 Does it return 100 issues or also 25 ? |
Hey, I think we use a real Redmine. Can check with our IT guys.
...
params.items()) On Tue, Sep 2, 2014 at 12:57 PM, Max Tepkeev notifications@github.com
|
Hmm... So it looks like it is the requests module that is giving you this problem, what requests version do you use ? |
2.3.0 On Wed, Sep 3, 2014 at 9:51 AM, Max Tepkeev notifications@github.com
|
I did some more testing and now I think it is not connected with the requests module. I believe it is a bug in the Python 3.1.2 itself, because I managed to reproduce this problem with it, but have no idea where it is coming from. I also tried the latest version from 3.1 branch (3.1.5) and it doesn't have this problem anymore. Also neither python-redmine nor requests doesn't officially support Python 3.1 branch so there won't be a fix for this from me because it is not the type of bug I can fix (it is not even in my code and looks like it is not in the requests code either). I can only recommend you to upgrade at least to Python 3.1.5, or if you can to Python 3.2 or higher. |
Sure. Thanks for looking into it. On Wed, Sep 3, 2014 at 10:55 AM, Max Tepkeev notifications@github.com
|
You're welcome. Also, if for some reason it is impossible for you to upgrade your Python version, you can create your own Redmine class and inherit it from the Redmine class, redefine the request method and use the fix you provided if it works for you. |
I use Redmine 2.5.3 and it seems that a code like this : project = redmine.project.get("my_proj") returns the set of 'open' issues in the limit of 100 elements. The messages in the log files seem to say the same thing. Thanks |
Hi, Not exactly, see: >>> len(redmine.project.get('foobar').issues)
464
>>> len(redmine.issue.filter(project_id='foobar'))
464
>>> len(redmine.issue.filter(project_id='foobar', status_id='open'))
464
>>> len(redmine.issue.filter(project_id='foobar', status_id='closed'))
1243
>>> len(redmine.issue.filter(project_id='foobar', status_id='*'))
1707 So yes, the default behaviour is to return all open issues, absolutely no limiting comes into play unless you ask for it via object slicing syntax, i.e.: >>> len(redmine.project.get('foobar').issues[:105])
105 |
Humm ... ok, I see. My problem was that when I used >>> redmine.project.get('foobar').issues I though I will get the whole set of issues but I get only the 'open' ones. Anyway, thanks for the quick answer. |
Returning only open issues is the default behaviour of Redmine API itself, but I can add a note in the documentation of course. |
Hi,
Using Redmine 2.4.2.stable and latest python-redmine, when trying to retrieve all the issues using the following code:
project = redmine.project.get("my_proj")
issues = project.issues
I get a list of 25 unique issues, repeating itself 21 times so that len(issues) = 21 * 25.
Thanks,
Ido.
The text was updated successfully, but these errors were encountered: