Rest API: End of artifact's history

Tuesday, February 22, 2022
Avatar

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:

  1. Add another POST API to receive amount of records that might be returned if I call original one request later.
  2. Change the logic of the original one API to send nothing as soon as I get to the end and after the end.
  3. Add attribute &stop=true to the original one API to apply such logic only for those clients, when it is needed.

Proposals doesn't contradict each other, so 1 and 3 (or 2) could be implemented in parallel to fix it.

1 Replies
Tuesday, February 22, 2022
Avatar
re: ilyapolyakov Tuesday, February 22, 2022

Please could you log a support ticket so your request can be added to our backlog.

Regards

David

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Tuesday, February 22, 2022
  • Last Reply: Tuesday, February 22, 2022
  • Replies: 1
  • Views: 2249