1 Reply Latest reply on May 14, 2013 10:59 AM by Shobhit Tyagi

    How to get the task workItemId

    arun_kumar Newbie

      Hi,

       

      I have List of TaskSummary . I want to know how to get the workItemId using taskId or is there any other options to get the task workItemId?

        • 1. Re: How to get the task workItemId
          Shobhit Tyagi Master

          To get the workitem id, this is what you can do..

          First you need the object Task.

           

          TaskClient objClient = new TaskClient(new HornetQTaskClientConnector(strName, new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
          objClient.connect(strIpAddress, intPort);
          BlockingGetTaskResponseHandler objResponseHandler = new BlockingGetTaskResponseHandler();
          Task objTask = new Task();
          objClient.getTask(intTask, objResponseHandler);
          objTask = objResponseHandler.getTask();
          

           

          Once you have the object, you can use it like following to get workitem id..

           

           

          intWorkItemId = objTask.getTaskData().getWorkItemId();
          

           

           

          Regards,