Notifications are not sent to delegates if approver is changed in an active approval

Description

If the approver is changed in an active approval and the new approver has a delegation set up, the chosen delegate does not receive a “Call Delegates For Action” notification.

Steps to reproduce:

  1. Create a definition for user A with the “Allow change of the user during the process” option enabled

  2. Create an active delegation from user B to C

  3. Start an approval using the definition from point #1

  4. In the new approval, change the approvers user A to user B

  5. As user C, check notifications


Change

  • When the approver of an active user step is changed, in the approval panel or through the work item field that drives the step, the new approver's active delegates now get the "Call delegates for action" notification, the same as when a step starts. It goes through every channel step start uses: email, Jira notification or Confluence page comment, and Slack.

  • The new approver still gets "Step reassigned".

Decisions

  • Delegates of the previous approver get no new message.

  • A step that has not started yet notifies the delegates when it starts.

  • The delegate notification uses the existing "Call delegates for action" template and is sent only while both "Call for action" and "Call delegates for action" are on in Message templates.

  • In Slack channel mode and in Confluence page comment mode, the delegates get their own post or comment, separate from the "Step reassigned" one.

  • In Slack channel or both mode, the delegates' post mentions each as "@delegate (on behalf of @approver)", the standard delegate mention, so the new approver is tagged again.

  • Group steps work as before.

Fixes included

  1. Security: in Jira with Slack, a delegate's fallback email now carries action links issued to the delegate (deciding "on behalf of" the approver) instead of the approver's own links. This also covers the call for action at step start and group delegates, who now get their own action buttons in that email.

Manual tester notes

  • Create a definition with a user step for user A with "Allow change of the user during the process" on. As user B, create an active delegation to user C for the project. Start an approval and change the approver from A to B in the approval panel. C gets "Action required ... (on behalf of B)" and can act on the step; B gets "Step reassigned"; A gets "Removed from step".

  • Repeat with a user step that has not started yet (an earlier step is still pending). C gets nothing after the change, and gets the delegate notification once the step starts.

  • Turn off "Call delegates for action" in Message templates and change the approver again: C gets nothing.

  • In Confluence, do the same on a page approval with page comments as the notification channel: a page comment mentions C.

  • Slack DM delivery with email actions without login on and a delegate with no Slack account: reassign the active step to an approver who has that delegate. The delegate's email buttons record the decision as the delegate on behalf of the approver, and stop working after the delegation is removed.