LEGACY CONTENT
This article refers to legacy products, components or features. Therefore, the content in this article is offered "as is" and will no longer be updated. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Introduction

If a new K2 user tries to open the K2 Worklist item via code, the user would be blocked stating that the user does not have permissions to access his Worklist item and then the user’s Worklist item would be removed.

Error Scenario
 

Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.
  1. Create a role in K2 Workspace which contains a group with a user who has never participated in K2 before
  2. Add that role to a client event on a new process - Deploy
  3. Start an instance
  4. Try and open the item using this code,
  5. //Create new client connection
         SourceCode.Workflow.Client.Connection Conn = new SourceCode.Workflow.Client.Connection();
    //Open connection to server
         Conn.Open(“Your Server Name”);
    //Notice that the user below is not part of Licensed Users within K2 Workspace -> K2 Management console
         Conn.Impersonate(“The user within the group – who has never participated in K2 before”);
         WorklistItem wli = Conn.OpenWorklistItem(“Get the serial number – login as another user who has participated in K2 before and obtain the serial number”);
    //This will verify that the impersonated user can access the item in there list
         Console.WriteLine(wli.Actions.Count);
         Console.Read();

  6. Worklist item should open successfully and result should display 1.
Important: The workitem state should not be Open, but should be Active

Error Message

Even though the user has permissions to the K2 Worklist item, you should get an error message depicting that he doesn’t.

Error Resolution

This Hotfix is contained within the latest K2 blackpearl Update. Install the update package to resolve the error.

The latest K2 blackpearl 0807 Update is available as an independent installation package which can be found here: https://portal.k2.com/downloads/bp/Default0807.aspx