It's all about the answers!

Ask a question

WorkItem not updated after saveWorkItem2(...)


Florian Georg (19031918) | asked Sep 22 '11, 5:54 a.m.
I try to programmatically set the state of a workItem... based on API documentation, the right way would be to give an actionId to the saveWorkItem2 operation:

[...]

IWorkItemServer workItemService = getService(IWorkItemServer.class);
workItemService.saveWorkItem2(storyItemWorkingCopy, null, "some.resolve.action.id");


This works, and returns an OK status - however, it does not seem to work, e.g. the workitem is not updated with the new state afterwards..

Any ideas?

3 answers



permanent link
Laurence Caraccio (9166) | answered Sep 22 '11, 6:45 a.m.
I try to programmatically set the state of a workItem... based on API documentation, the right way would be to give an actionId to the saveWorkItem2 operation:

[...]

IWorkItemServer workItemService = getService(IWorkItemServer.class);
workItemService.saveWorkItem2(storyItemWorkingCopy, null, "some.resolve.action.id");


This works, and returns an OK status - however, it does not seem to work, e.g. the workitem is not updated with the new state afterwards..

Any ideas?


Are you saving the work item working copy after? so:

 storyItemWorkingCopy.save(IProgressMonitor p) 


If you are then without seeing the full code I'm not sure I can help

permanent link
Florian Georg (19031918) | answered Sep 22 '11, 12:58 p.m.
Thanks for the point... it seems that I'm somehow mixing Service- with Client side API?

Just to be clear - I'm inside a server-side workItem Participant, and not on the client side.
Therefore, I have only "Services" and no WorkItemWorkingCopy instance (and no save() method), and no IWorkItemWorkingCopyManager and such, which are part of the "client" API ... my "WorkingCopy" is of type IWorkItem.
All I have is IWorkItemCommon and IWorkItemServer and IRepositoryItemService

So perhaps I'm using some bad pattern here?

thanks for any hint...



I try to programmatically set the state of a workItem... based on API documentation, the right way would be to give an actionId to the saveWorkItem2 operation:

[...]

IWorkItemServer workItemService = getService(IWorkItemServer.class);
workItemService.saveWorkItem2(storyItemWorkingCopy, null, "some.resolve.action.id");


This works, and returns an OK status - however, it does not seem to work, e.g. the workitem is not updated with the new state afterwards..

Any ideas?


Are you saving the work item working copy after? so:

 storyItemWorkingCopy.save(IProgressMonitor p) 


If you are then without seeing the full code I'm not sure I can help

permanent link
Laurence Caraccio (9166) | answered Sep 23 '11, 4:40 a.m.
I think ti was me misunderstanding I've only used the client side so I wont be able to help unfortunately :/

Your answer


Register or to post your answer.