Retrieving Out of Office Worklist

  • 15 December 2011
  • 3 replies
  • 0 views

Badge +1

Hello,


Recently I am trying to work with Out of Office feature through K2 API. I have the following scenario:


I got two users: User1 and User2. User1 already has 10 work items in his worklist, while User2 has 5 work items. User2 goes Out of Office and forwards all of his work items to User1. In User1's worklist in K2 Workspace 15 work items appears (as expected), but when I tried to retrieve User1's worklist through K2 API, I only got 10 items (5 items forwarded from User2 does not appear.


Is there any way I can retrieve those forwarded items through K2 API? Or can I get the list of work items exactly as it appears on K2 Workspace? I only see OpenSharedWorklistItem method which is specific to a certain work item.


Appreciate any help. Thanks.


3 replies

Badge +10

Hi,


You need to create a new WorklistCriteria object and specify the filters as below for the extra items to show up:


criteria.AddFilterField(WCLogical.AndBracket, WCField.WorklistItemOwner, WCWorklistItemOwner.Me.ToString(), WCCompare.Equal, 0);
criteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, WCWorklistItemOwner.Other.ToString(), WCCompare.Equal, 0);


The code above should return all the items. When you need to open an item which has been delegated, the procedure is also slightly different. There is a code example in the K2 Documentation which can be found in the following section:


 Developer Reference > Processes > Accessing > How to Open a Worklist when Out of Office is Activated (http://help.k2.com/helppages/K2blackpearlDevRef1420/Working_with_Worklists_modified_by_Out_of_Office.html)


I hope the above helps!

Badge +1

Hi,

The code provide doesn't work, i got the error : Incorrect syntax near ‘)’ 

Thx for help, if you solved you plz share :) :)

Regards,

Jay-Z

Badge +5


Hi JayZ,


 


Have a look at the following links from our K2 blackpearl Developers Reference.


 




 


Hope this helps


 


Kind Regards


 


Julia



Reply