Get Assigned WorkItems

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business Rules examples > Cases and activities >

Get Assigned WorkItems


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);
for(var i=0;i<myWorkItems.Count;i++){
  var Newrecord = Me.newCollectionItem("SimpleProcess.AssignedWorkItems");
  var workItem=myWorkItems[i];


The collection is shown like this: