Enable dynamic updates and group behavior for Issue Field User step

Description

Allow updates and enhanced handling of users for the Issue Field User step in approval definitions.

Scope of changes:

  1. New options in the Issue Field User step form:

    • Treat users as a group – a group step will be created with all users retrieved from the selected issue field.

    • Dynamically update users when the step is active – users will be added or removed based on the current contents of the issue field.

  2. When the "Dynamically update users" option is selected:

    • Users will receive notifications when:

      • they are added to the step – informing them they need to cast a vote,

      • they are removed from the step – informing them they no longer need to vote or their decision is not valid any more.

  3. If "Treat users as a group" is selected, the following fields (same as in Group step) should be available:

    • Number of votes required for group step to pass

    • Exclude users from group

    • Exclude approval creator from group

    • Skip the group from the approval if it doesn't contain any users

From the technical side, we need to listen for changes in issues and check whether the change affects any custom fields of type user or the description field.
If so, we should find approvals that have an active step created based on a Work Item User Field step with the option "Dynamically update users" enabled, and update the list of assigned users accordingly.
This should be done using issue_updated webhook analogically to how we handle other Atlassian webhooks. https://developer.atlassian.com/cloud/jira/platform/webhooks/

Add global flag that enables dynamic steps - by default turned on.

Each update should create new approval version - approval versions will be visible on approvals details view above the Approval component - versions can be switched by changing select with approval versions.

Add options to control whether dynamic steps are available in the General tab. Use the radio group component to start with the Work Item User field - later we will add further options with the ability to change all of them.

it would also be necessary to add new templates to customize notifications for emails sent to people added/removed from the active step

Add these options also to the REST API for creating definitions

When it comes to UI, add the changes from


adapt the Exclude from group component to the requirements, make it collapsible - we can wait for this task to be released or at least in test to adapt design improvements.

For testing:
Note that after you update users in custom field, there will be like 15s delay before new approval version is created (we need to wait for issue update webhook and process approvals). After around 10-15-20s (not sure how long it will take) you can refresh the approval lists to see new approval version.