Work item fields: group and vote members in Pending Approvers, groups and email addresses in separate fields
Description
Problem
A customer (SUP-4140) approves requests with Group steps built from a multi group picker field, where one member of each group has to approve. To see who still has to decide, they run two automations with web requests that copy the pending groups and their members into their own custom fields. Approval Path's work item fields do not cover this:
-
Pending Approvers lists only the users of User steps, not the members of Group and Vote steps who still have to decide.
-
Pending Approver Groups & Emails mixes group names and external email addresses in one list.
Change
-
Pending Approvers lists everyone who can decide on an active step now: the user of a User step, the members of a Group step who have not decided yet (without excluded users), the voters of a Vote step who have not voted yet (the moderator once the voting deadline passed or everyone has voted), and the active delegates of all of them. These are the same people JQL finds with
pendingApproverAccountIdAllSteps: the field reads the stored pending approvers, so writing it makes no extra Jira calls. The field keeps its limit of 100 users. A step with more than 500 accounts adds no one, as in JQL. -
Pending Approver Groups & Emails is renamed Pending Approver Groups and lists only the groups of active Group and Vote steps. Its key does not change, so screens, filters and automations that use it keep the field. On production the field is used on two sites and holds an email address on one work item.
-
New read-only field Pending External Approvers (list of text values): the external email addresses of active Email steps that still wait for a decision.
-
The fields also follow changes that happen without an approval action: a delegation starts or ends (checked every 5 minutes), a voting deadline passes (every 5 minutes), the periodic check finds a changed group membership (every 12 hours), or a user is deleted. A work item is queued only when its pending approvers changed, and all fields still go in one bulk Jira call per 50 work items.
-
When Jira cannot return a group's members at the moment, or a refresh fails, the work item is refreshed again within about 30 minutes.
-
After the release, a one-time upgrade task queues every work item with an in-progress approval on sites that have the fields turned on, including sites where the app is disabled at the moment (they are written once the app is enabled again). The work items are written from 10 minutes after the new backend starts, behind live updates, up to 50 work items per site per minute. A second pass at that time queues again the work items that the previous version wrote meanwhile.
-
The docs page about the work item fields is updated in a separate step.
Decisions
-
Pending Approvers uses the same stored pending approvers as JQL and Rovo. A step whose members Jira cannot return keeps its last known members, minus anyone who decided since, until the retry about 30 minutes later. A step that was never resolved adds no one.
-
The backfill only queues work items; the regular flush writes them in chunks of 50 with one bulk call each, live updates first.
Out of scope
-
JQL stays as it is:
pendingApproverAccountIdstill covers User steps only,pendingApproverAccountIdAllStepsalready covers every step.
Release order
-
Deploy the Forge manifest (new field, new name) before the backend. The backend skips fields Jira does not have yet: a backend that runs first moves email addresses out of the groups field before the new field exists, and its backfill leaves the new field empty until the next change on each work item.
Acceptance criteria
-
A Group step waits for three members and one of them approves: Pending Approvers lists the other two until the step finishes; Pending Approver Groups lists the group.
-
A Vote step lists the voters who have not voted yet; after the voting deadline only the moderator (and the moderator's delegates) is listed.
-
A delegate of a pending approver is listed while the delegation is active and is removed within about 5 minutes after it ends, without any action on the approval.
-
An Email step that waits for a decision shows its address in Pending External Approvers and not in Pending Approver Groups.
-
On a site that already had the fields, the groups field is named Pending Approver Groups after the release, stays on its screens, and work items with in-progress approvals show the new values without any new action.
-
When no approval on the work item is in progress, all three fields are empty.
Manual tester notes
-
Add Pending Approvers, Pending Approver Groups and Pending External Approvers to a work item screen (names on qa carry the environment suffix).
-
An approval started before this change reached qa shows the new values about 10 to 20 minutes after the deploy, without any action on it.
-
Customer's setup: Group steps from a multi group picker field with three groups, one approval needed per group. All members and all three groups are listed. Approve as a member of one group: that group and its members leave the fields, the other groups and their members stay.
-
Group step that needs several approvals: after one member approves, that member leaves Pending Approvers and the others stay.
-
Delegation: create an active delegation from a pending group member; the delegate appears in Pending Approvers within a few minutes. End it; the delegate disappears within about 5 minutes.
-
Vote step with a voting deadline a few minutes ahead: after it passes, only the moderator (and the moderator's delegates) is listed within about 5 minutes.
-
Email step: the address is in Pending External Approvers and not in Pending Approver Groups.
-
A group with 100 to 500 members: Pending Approvers shows 100 users and nothing breaks.
-
Finish the approval: all three fields are empty.
-
Regression: Approval Status, Approval Progress, Approval Percentage, and the JQL fields
pendingApproverGroupNameandpendingApproverExternalEmailreturn what they returned before.
Before release
-
Forge deploy of the Jira manifest (renamed groups field, new Pending External Approvers) before the backend. Every developer's local manifest needs a redeploy.
-
After the backend deploy the logs show
#M29: Completed. Queued N work items, pushed from <time>and, 10 minutes later,#M29: Second pass queued N work items again; the priority-1 rows ofcustom_field_push_queuedrain afterwards. -
No "approval custom fields available" warnings for sites with the fields turned on (that warning means the manifest is missing).
Fixes included
-
On a step whose stored pending approvers are kept (members Jira cannot return, or a step with too many accounts), a delegate who decided for a member is removed from the pending approvers too; a delegate who still decides for another undecided member of the group stays listed, like a moderator.
-
A background refresh that Jira refuses (an answer 4xx other than 429, for example from a deactivated site) is not scheduled for an extra retry; 401 and 403 already were not.