|
From: Robert M. <rob...@gm...> - 2011-05-22 19:59:30
|
On Sun, May 22, 2011 at 11:48 AM, Dirk Haun <68...@gm...> wrote: > I want to iterate through all the issues in our Mantis instance, using > the SOAP API. I'm calling mc_project_get_issues, and after lowering > the number of issues per page (with 50 per page it would always throw > an exception on page 4, for some reason), I now get all the issues I > want. Can you report that exception on mantisbt.org/bugs/ ? > > My only problem now: How do I detect the end? It seems that increasing > the page number will only return the same result for the last page > over and over again. This bug will be fixed in the upcoming 1.2.6 release. 12991: mc_filter_get_issues returns incorrect results for page_number > page_count http://www.mantisbt.org/bugs/view.php?id=12991 If you need to find out the last page, I suggest you perform a check on your side. The safest should be remembering the bug id you received on index 0. If you get the same bug in two consecutive calls, you've reached the end. Not ideal, but will be fixed in the next release. > > I could check if I've seen these issues before but surely there must > be an easier way? Can I get the total number of issues for a project, > for example? There's a feature request for that 8656: please provide function that return issue count of current filter http://www.mantisbt.org/bugs/view.php?id=8656 But no one has stepped up to implement it yet. > > Code snippet: > > for ($p = 1; $p <= 1000; $p++) { > $issues = $m->mc_project_get_issues($user, $pwd, $project_id, $p, 25); > if (! is_array($issues)) { > break; > } > // display issues here > } > > ... and it just goes on and on. > > P.S. I didn't know this list existed. It's not listed on > http://www.mantisbt.org/mailinglists.php but only when you follow the > link to the SourceForge Mailing lists. Good point. I'll have this added to that page. Robert > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Mantisbt-soap-dev mailing list > Man...@li... > https://lists.sourceforge.net/lists/listinfo/mantisbt-soap-dev > -- Sent from my (old) computer |