Get the exact status of the task when the sprint is closed


We are trying to calculate planned efforts and actual efforts for a sprint. Right now, we are getting the project board id, then the sprints in that board and then the issues in each sprint and finally iterating all the issues to get efforts. Is there any easiest way to get all the tasks in a sprint ? and also the rest apis are giving the current status of the task but not the exact status when we close the sprint. Is there anyway to get the exact status of a task when the sprint is closed ?
Second issue is regarding velocity chart. Why doesn’t it include the story points of the tasks that are added in the middle of the sprint to committed but includes them in the completed if the status of the added task is done.

Thanks in advance.

Hi @it1

Just using a simple /rest/api/3/search?jql=project=XXX AND sprint="Sprint 123" will give you all the items in a sprint. Adding &expand=changelog to the API call will give you the history for each item. You then need to iterate through each item.changelog.histories and for each of those iterate through histories.items - you can check the date of each change so you can work out what the last state change was before the end of the sprint.

As to the velocity chart, your sprint commitment is only at the start of the sprint, so committed will be those items at the beginning of the sprint - what you’ve described is the correct behaviour in my opinion.