Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

RTC Plain Java API, How to refresh/refetch a workitem as it is throwing MultiStaleDataException

 hi Team,


We are trying to attach a workitem to the main workitem and then close the main workitem. On Closing the main workitem, API is throwing MultiStaleDataException : Stale Data

 IWorkItem workItem = workItemClient.findWorkItemById(workItem1.getId(), IWorkItem.FULL_PROFILE, null); 

is not fetching the fresh copy of the workitem.

Following is the code for the same :
IWorkItemWorkingCopyManager copyManager = null;
    IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
    copyManager = workItemClient.getWorkItemWorkingCopyManager();

    copyManager.connect(workItem1, IWorkItem.FULL_PROFILE, null);
    WorkItemWorkingCopy wc = copyManager.getWorkingCopy(workItem1);
    IWorkItem workItemWorkItemCopy = wc.getWorkItem();
    copyManager.save(new WorkItemWorkingCopy[] { wc }, monitor);

    copyManager.disconnect(workItem1);
    

0 votes



One answer

Permanent link

 You should use a WorkitemOperation to update work items. See https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and search for WorkItem Operation.


  

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 7,494
× 1,324

Question asked: May 30 '23, 2:21 a.m.

Question was seen: 1,030 times

Last updated: Jun 13 '23, 9:21 a.m.

Confirmation Cancel Confirm