Hi Arjuna,
Have a look at the help files, or the developer reference/SDK it is full of sample code and examples of this. The following is a slightly modified version that should get you going...
public void ActionWorklistItem()
{
// TODO: Replace these placeholder values with values for your environment
string _serverName = "blackpearl";
string _user = "K2Student";
string _domain = "DENALLIX";
string _password = "K2pass!";
string _wfSerialNumber = "4_12";
string _action = "Manager Reviewed";
SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionString = new SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();
connectionString.Authenticate = true;
connectionString.Host = "localhost";
connectionString.Integrated = true;
connectionString.IsPrimaryLogin = true;
connectionString.Port = 5252;
connectionString.UserID = _user;
connectionString.WindowsDomain = _domain;
connectionString.Password = _password;
connectionString.SecurityLabelName = "K2"; //the default label
// open a K2 connection
Connection connection = new Connection();
connection.Open(_serverName, connectionString.ToString());
try
{
// open the worklist item
connection.OpenWorklistItem(_wfSerialNumber);
worklistItem.Actionssaction].Execute();
}
catch (Exception ex)
{
// write error to console
//Console.WriteLine("Error: " + ex.Message);
//Console.ReadLine();
throw();
}
finally
{
// close the connection
connection.Close();
}
}