Skip to content

Conversation

@gproly
Copy link
Contributor

@gproly gproly commented Dec 24, 2025

… user list

Description

When Assignment type=process variable and variable Name (groups) is set with a correct value then when reassign button is pressed, only the process manager is listed.

Related tickets

https://processmaker.atlassian.net/browse/FOUR-28520

..>


Note

Improves reassignment user listing to honor process variables and complex rules.

  • API: UserController@getUsersTaskCount (POST) now evaluates assignment rules, including rule_expression and new process_variable, using form_data; filters results to assignable users.
  • Model: Adds ProcessRequestToken::getUsersFromProcessVariable to collect direct users and users from groups (including subgroups) and validate IDs.
  • Frontend: Centralizes getReassignUsers in resources/js/tasks/api/index.js to POST users_task_count with form_data, and excludes the current assignee; updates reassignMixin and TaskPreviewAssignment to use it and pass formData/currentTaskUserId from TasksPreview.
  • Tests: Adds comprehensive unit tests for getUsersFromProcessVariable covering direct users, groups, combined, empty, non-array, and invalid IDs.

Written by Cursor Bugbot for commit 745cc92. This will update automatically on new commits. Configure here.

ci:deploy

… user list

 ## Description
When Assignment type=process variable and variable Name (groups) is set with a correct value then when reassign button is pressed, only the process manager is listed.
 ## Related tickets
https://processmaker.atlassian.net/browse/FOUR-28520
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

gproly added 2 commits January 6, 2026 17:41
… to extract user IDs from form data (assignedUsers/assignedGroups variables).

Uses Process::getConsolidatedUsers() to get users from groups recursively.
Validates array inputs and filters invalid IDs. Includes PHPUnit tests.
@eiresendez eiresendez self-requested a review January 7, 2026 14:30
@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-c42676abcc.engk8s.processmaker.net

}
if ($assignmentRule === 'process_variable' && $request->has('form_data')) {
$include_ids = $processRequestToken->getUsersFromProcessVariable($request->input('form_data'));
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule expression filtering removed when config disabled

High Severity

The rule_expression assignment logic was moved inside the reassign_restrict_to_assignable_users config check block. Previously, when this config was false, the rule_expression check would still execute and filter assignable users accordingly. Now, when the config is false, neither rule_expression nor process_variable filtering occurs, causing users with rule_expression assignment rules to see all users instead of filtered results. This is a regression in existing functionality.

Fix in Cursor Fix in Web

const response = await getReassignUsersApi(
filter,
this.task?.id,
this.task?.request_data,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixin uses stale request_data instead of current formData

Medium Severity

The mixin's getReassignUsers method now uses this.task?.request_data instead of this.formData. In tasks/edit.js, the show() method directly calls this.getReassignUsers() from the mixin, and the component has its own formData property that holds the user's current form edits. The change means rule expression and process variable evaluation will use the task's original stored data rather than the user's current form modifications, potentially showing incorrect assignable users if the form data affects assignment rules.

Fix in Cursor Fix in Web

@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-c42676abcc.engk8s.processmaker.net

@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-c42676abcc.engk8s.processmaker.net

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants