It's all about the answers!

Ask a question

How to change a Work Item state via server side plugin using server side SDK -


Farheen Taj (11) | asked Aug 03 '23, 9:00 a.m.

 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


permanent link
Ralph Schoon (63.3k33646) | 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


Register or 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.