Selecting "Upcoming Iterations" value of 0 prevents current iteration from being created

Description

Expected

When "Enable automatic scheduling" is selected on an iteration cadence, and "Upcoming iterations" is set to 0, no upcoming iterations should be created, but the next current iteration should still be automatically created and roll over issues at the end of every iteration

  • 0 = Creates current iteration, but none in the future.
  • 1 = Creates current iteration, plus 1 in the future.
  • 2 = Creates current iteration, plus 2 in the future.
  • ...

Actual

If 0 is selected, the current iteration is not automatically created.

  • 0 = Doesn’t automatically create any iterations, not even the current one.
  • 1 = Creates current iteration, plus 1 in the future.
  • 2 = Creates current iteration, plus 2 in the future.
  • ...

Background

Some workflows only ever use the current iteration, and never use the future-calculated ones. But originally, the "Upcoming Iterations" dropdown could only have a minimum number of 2, which resulted in two extra unused iterations always existing (which are sometimes incorrectly selected in quick-action autocompletes)

In Allow zero for cadence iterationsInAdvance (!151299 - merged), this was changed to allow a value of 0 in the "Upcoming Iterations" dropdown.

However, this uncovered this bug, where setting the value to 0 does not automatically create even the current iteration.

Edited by Chad Woolley