Order of sprints created by API

Hi

I use the “sprint” API to create sprints in a board in our Jira Cloud instance:
https://developer.atlassian.com/cloud/jira/software/rest/api-group-sprint/#api-rest-agile-1-0-sprint-post

I create a new sprint by API with the following data :

{
  name: '24.Q2 IT - S1 - OCA',
  originBoardId: 54,
  startDate: '2023-03-25T00:00:00.000Z',
  endDate: '2023-04-06T23:00:00.000Z'
}

The sprint is created just below the current active sprint, and not below all others, even if the dates are after:

Doing the same operation using the UI places the new sprint at the end of the list.

Any idea why the UI and API have different behaviors ? How can I change this using the API request ?

Thank you

Hello @romainarpin

I cannot duplicate that issue. When I create sprints using the REST API, the newly created sprints are always at the bottom of the list, in the exact order I create them, irrespective of their start or end dates or their names, exactly the same as the GUI. I cannot find any way to make a sprint created via the REST API suddenly ‘jump up’ the order of sprints in the GUI as you described.

I think that you’ve not taken the human factor into account :slight_smile: Unbeknown to you, someone else is just moving the sprint to a different position in the list once it’s created. I suggest you create a dummy board that only you can access and do your testing there.

1 Like

Hi @sunnyape

It’s not an human factor, I create sprints in my team’s board, check them immediately, and no one in the team modify them.

But you’re right it works fine with a newly created board.

My existing sprints were initially created by a plugin on an “onpremise” instance and then migrated to the cloud: maybe that’s why…
I’ll recreate all of them by API, then delete the existing ones. Should work fine.

Thank you for the help

1 Like