python-2.7redmineredmine-apipython-redmine

python redmine how to get all the issues in a project as xml or json?


I have more than 1500 issues in my project I need to check each issues using python Redmine API but it limits default by 25 and I can extend up to 100 but how can I check for all 1500 issues.


Solution

  • You have 2 options:

    1) Use python-redmine:

    from redmine import Redmine
    
    rm = Redmine('http://you-redmine-server-url', username='foo', password='bar')
    
    for issue in rm.issue.filter(project_id='my_project'):
        # do smth with your issues, e.g. print issue.subject
    

    2) Write the code yourself. As you said Redmine's REST API doesn't allow you to get more than 100 resources (in your case issues) per request, so you have to make the first request where you will get first 100 resources and the number of total issues available, then calculate the number of loops you have to make to get all your issues and start making these loops, retrieving 100 issues per loop until you get all of them. This is exactly what python-redmine does under the hood.