Bizagi offers a function where you can obtain an array of the WorkItems assigned to a given user.
To obtain a user's assigned WorkItems use the following function:
CHelper.getAssignedWorkItems(Me, CaseId, CurrentAssigneeId, IncludeSubProcesses)
The following attributes are needed:
•Me: Fixed value.
•CaseId: Case Id
•CurrentAssigneeId: The current assignee's id
•IncludeSubProcesses: If you wish to include Sub-processes set this parameter as true.
In the following sample rule, we'll be obtaining the creator user's assigned WorkItems for a simple process. This rule is executed On Enter for the task Simple Example.
The code is as follows
var myWorkItems = CHelper.getAssignedWorkItems(Me, Me.Case.Id, Me.Case.Creator.Id, false);
var Newrecord = Me.newCollectionItem("SimpleProcess.AssignedWorkItems");
The collection is shown like this: