How to change a Work Item state via server side plugin using server side SDK -
Hi All,
We are trying to perform some backend actions via Participant plugin (Server side). Once the actions are done want to change the sate of the work item from New to In Progress. I got a code on how its done in client side plugin. But we are trying to achieve this action on server side plugin. Can you please help me with in doing this. A small code snippet that is performing state change will be of great help.
Thanks in advance
Farheen
Accepted answer
I have tried to explain this here: https://rsjazz.wordpress.com/2012/11/26/manipulating-work-item-states/ .
The IWorkItem interface is available in the client and server API and exposes the deprecated method com.ibm.team.workitem.common.model.IWorkItem.setState2(Identifier<IState>). As explained that should not be used. To change a state of a work item is to apply a workflow action. In the server API you should use com.ibm.team.workitem.service.IWorkItemServer.saveWorkItem3(IWorkItem, IWorkItemReferences, String, Set<String>) or com.ibm.team.workitem.service.IWorkItemServer.saveWorkItem2(IWorkItem, IWorkItemReferences, String) and provide the workflow action to change the state.