Option to drop a work item field approval step when the field is cleared during an approval

Description

Problem

An approval step can take its approvers from a work item user field. With "Dynamically update users when the step is active" turned on, clearing that field while the approval is running stops the approval: the step stays open waiting for the field to be filled again, nobody can act on it, and the only way forward is to put a name back.

That is what we want when the field was cleared by mistake. It is wrong when the approver is genuinely no longer needed and the approval should simply move on. There is no setting to choose between the two.

Scope

A new option on the work item field approval step, off by default, for both plain user steps and steps using "treat users as group". It requires "Dynamically update users when the step is active".

On: clearing the field while the step is open (active, or still waiting for its turn) removes the step and the approval continues with the next approver. Off: unchanged, the step waits for the field.

The last approver cannot be removed this way. If no other step is left in the approval, the step stays and the approval keeps waiting, with the banner explaining why. What counts as another step:

  • any other step of the approval (user, group, email, vote, automation, webhook, AI prompt, notification);

  • not the cleared field's own steps, decided ones included (users of that field who already approved do not count);

  • not skipped steps, and not work item field steps that resolve their users only when they start (they could still turn out empty).

The two empty-field options are regrouped under one "When the field has no users:" heading, placed right after "Dynamically update users when the step is active", so each option only has to name its moment:

When the field has no users:[ ] at resolution time: keep the step waiting     (plain user steps)[ ] at resolution time: skip the step             ("treat users as group")[ ] after the step starts: remove the step        (new, both flavours)

Options that require dynamic updates are hidden while that setting is off. A hidden option keeps its value while the step is edited and is saved only when shown.

Tooltip on the new option: "The step is removed only if the approval has another step. If it is the only step, it stays and waits for the field, because an approval needs at least one approver."

Banner on a step kept this way: "Waiting for field to be populated. The approval will resume when the field value is set. This step is kept because the approval would be left without an approver."

Removing a step creates a new version of the approval. The removed step is no longer shown on the approval; earlier versions still show it. Active approvers of the removed step get the usual "removed from the step" notification.

The public web API (v2) definition step gets removeWhenEmptyAfterStart; a definition that sets it without dynamicUpdateEnabledis rejected with 400.

Fixes included

  1. Every dynamic field update now continues the approval the normal way. Before, when an update left no active step (for example one user of a multi-user field removed while the others had already decided), the next step was only marked active: its approvers were not notified, webhook and automation steps never ran, and an approval with nothing left to decide completed silently, without outcome steps, completion webhook, status comment or work item transition. Now the next step starts as after a decision, and a completed approval is finalized like any other.

  2. A dynamic update no longer puts users excluded from a "treat users as group" step (for example the excluded approval creator) back into the group, and a field that holds only excluded users counts as empty.

  3. When a field's only users were replaced (for example Bob replaced by Bartosz, or a waiting placeholder filled), the new approvers were moved to the end of the approval. They now take the replaced step's place.

  4. Approvals that can no longer be decided (archived, outdated, past the decision deadline) are no longer changed by dynamic updates.

  5. The automatic parallel group that holds the users of a multi-user field showed an internal number ("Parallel group 688881634"). It is now named after the field ("Users from Approvers") in the panel and on the web dashboard.

Acceptance criteria

  • New per-step option, default off, on both flavours of the work item field step; saved, reloaded and shown under the "When the field has no users:" heading; options requiring dynamic updates are hidden while that setting is off.

  • Option off: clearing the field mid-approval behaves exactly as today (waiting placeholder, or a group with no members, and the existing banner).

  • Option on, other steps present: the cleared field's open steps are removed, a new approval version is recorded, and the next approver becomes active and is notified.

  • Option on, no other step left: the step stays, the approval keeps waiting, and the banner adds that the step is kept because the approval would be left without an approver.

  • Decisions already made on that field's steps survive the removal.

  • If a removal leaves nothing to decide, the approval completes properly: outcome steps, notifications, completion webhook, status comment and the work item transition all run.

  • Fixes 1 to 5 behave as described.

Manual tester notes

  • Global setting: "Dynamic user field steps" must be on in Settings, otherwise the dynamic options are not offered and no field change is applied.

  • Jira webhooks for field changes can take up to a minute to arrive; wait before judging a result.

  • Plain flavour: field with several users, one approves, then clear the field with another step after it; the approved user stays on the approval, the next step becomes active and its approver gets an email or Slack message.

  • Completion: definition with a success step (for example "Change work item status") and the field step last; approve everything before it, clear the field; the approval is approved, the status changes, the status comment is posted, and a configured completion webhook fires (check Settings > Webhooks call log).

  • Rejection by removal: a custom parallel group whose rejection threshold is met once the cleared member is gone should complete as rejected with rejection steps.

  • Group flavour with "Exclude from group: Approval creator": set the field to the creator only; the step is removed (option on) or waits with the banner (option off).

  • Swap: replace the field's only user by another one; the new approver keeps the step's place and the following step stays waiting.

  • Slack: after any dynamic update, the Slack messages of the approval's active steps are marked "reassigned" (existing behaviour, see out of scope); check that the newly activated approver gets a fresh Slack message.

  • Web API v2: create a definition with removeWhenEmptyAfterStart: true and dynamicUpdateEnabled: false; expect 400.

  • Archived approval with a dynamic field step: change the field; the approval is not modified (no new version).