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
Ralph Schoon (63.4k●3●36●46)
| answered Aug 04 '23, 2:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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.
Ralph Schoon selected this answer as the correct answer
Comments
Farheen Taj
commented Aug 07 '23, 6:44 a.m.
This solution helped me in implementing state change. Thanks for the quick response :) |
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.