Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > SpiraTeam Issues & Qu... > Rest API: End of artifact...
Hi All,
If I run:
https://eti.spiraservice.net/Services/v6_0/RestService.svc/projects/43/artifact-types/6/artifacts/27000/history?start_row=1&number_rows=20&sort_property=HistoryChangeId&sort_direction=desc
Spira returns 8 history items. So, we know that in reality there are 8 such history records.
But If I run:
https://eti.spiraservice.net/Services/v6_0/RestService.svc/projects/43/artifact-types/6/artifacts/27000/history?start_row=21&number_rows=20&sort_property=HistoryChangeId&sort_direction=desc
It returns again 8 records. Expected behaviour to return nothing as start_row is out of available array of records.
Why does it matters? Let's imagine that my goal is to receive all the history. So, I don't know number of rows what to set for number_rows attribute. Let's Imagine that I am using windowing of 8 records per request. So, sending:
https://eti.spiraservice.net/Services/v6_0/RestService.svc/projects/43/artifact-types/6/artifacts/27000/history?start_row=1&number_rows=8&sort_property=HistoryChangeId&sort_direction=desc
I will receive 8 records. But I don't know are there any other records, so will send again:
https://eti.spiraservice.net/Services/v6_0/RestService.svc/projects/43/artifact-types/6/artifacts/27000/history?start_row=9&number_rows=8&sort_property=HistoryChangeId&sort_direction=desc
But will receive again 8 records so I won't get a signal that there are no more records in a history and will request Spira again and again.
As a manager, I don't like messages without proposals, so will try to do the same here. Possible ways to solve it:
Proposals doesn't contradict each other, so 1 and 3 (or 2) could be implemented in parallel to fix it.
Please could you log a support ticket so your request can be added to our backlog.
Regards
David
And if you have any questions, please email or call us at +1 (202) 558-6885