Hi
I was wondering if the behaviour I see is intended.
Lets say for example I have 70 cards.then http://mingle/projects/project/cards.xml?page=1returns the first 25 cardsand http://mingle/projects/project/cards.xml?page=2returns the next 25 cardsand http://mingle/projects/project/cards.xml?page=3returns the last 20 cardsBUTthen http://mingle/projects/project/cards.xml?page=4also returns the last 20 cardsand so on.
I would have thought that once I have viewed all the pages required to show all the cards for a specific set of filters I would be not keep getting the last result set over and over again.
Any suggestions on figuring out how many pages I should be retrieving for a query?
Here is the info from the Mingle Help file.
page : A specific set of 25 results, if the list contains more than 25 results. The first 25 results are page 1. The next 25 are page 2, and so on.
ThanksRudi
Comments
7 comments
Hello rnwolf – we maybe need to be more specific in the help file about what happens when the page number is greater than the last valid page number, but I would like to assure you that what you are seeing is as per design.
Asking for the contents of a page of data that is past the last valid page, returns the data on the last valid page.
To figure out the page number of the last page of data, you can calculate it by dividing the total number of cards in a view by the number of cards in a page. As an example,
a) a view with 25 cards or less will always have only one page
b) a view with between 25-50 cards will have 2 pages
c) a view with between 50-75 cards will have 3 pages
and so on.
If on a view with only 35 cards, you request the first page of cards, you will get cards from 1-25. Page 2 will contain cards 26-35. Any page number past 2 will behave identically to a request for the last page.
Thanks for the quick reply.
Yep, please update the Mingle help file. I thought that pages past the last valid page would return an empty card array.
Is there a way to determine the number of cards in a view?
Right now the only way I can think of figuring out if I have all the cards is to check if the results returned by page n = page (n-1). If so then I must have all the cards.
Thanks
Rudi
Why is this by design? It seems to me that if i’m querying the system, that I should be able to get all of the cards in a single query without having to do the paging. We’re trying to use the cards with Word & Excel, and having this information being paged is pretty annoying… Isnt there any way to have mingle return all the cards for that story?
thx
Ben
I think i found a work around for the paging. If you have a view that is a grid, then mingle will return ALL of the cards for you, since grid’s dont have paging.
Hi all
We are currently considering updating the API to allow requests for all cards. We will keep you posted on our progress.
Cheers Suzie
This is may be a simple question, how do I get the count of all cards through the REST api
Only then can I loop and get all the pages. Is there a better way of doing this.
Hey all, I just noticed that in Mingle 2.1 (the latest release of Mingle as of 22 Oct 2008), you can fetch all the cards without all this pagination business… it’s as simple as: http://yourname:password@your.mingle.server:8080/projects/test_project/cards.xml?page=all
Check it out here: http://studios.thoughtworks.com/mingle-agile-project-management/2.1/help/mingle_api_cards.html
Thanks, Mingle team! You really listen to your users. :-)
Please sign in to leave a comment.