Skip to main content

Hi,


I need a big help from you all.. I am able to reassign a work list item from one user to another user programmatically without any issues.  My Problem is when instead of reassigning a task to one user, I want to reassign to an Active Directory group in which case, all users who are in that AD group can open/process a task. How can I achieve this? 


 When, I use the following code to reassign, it works perfectly for one user, but, it does'nt work nor error out when reassigned to AD group...The task is neither in the original user's task list nor visible to anyone from that AD group. 


Please someone help me here...


My code to reassign a task to either user or to AD group:


//impersonate with current processor
connection.ImpersonateUser(OriginalProcessor);


//Open the impersonated user's work list
Worklist workList = connection.OpenWorklist("ASP");


foreach (WorklistItem workItem in  workList)
{


if (workItem.SerialNumber.Equals(SerialNumber))
{
if (workItem.Status == WorklistStatus.Allocated)
{
 connection.ImpersonateUser(workItem.AllocatedUser);
 WorklistItem allocatedItem = connection.OpenWorklistItem(SerialNumber, "ASP");
 allocatedItem.Redirect("UserName"); //destination username here
 connection.RevertUser();
 break;


}
else if (workItem.Status == WorklistStatus.Open || workItem.Status == WorklistStatus.Available)
{
workItem.Redirect("UserName");//destination username here
break;


}


}


}


 

Be the first to reply!

Reply