Set state of a work item programatically
As the title say's I'm trying to set the state of a work item programatically so from new to in progress for example, I initially tried using
workItem.setState2(Identifier<IState>); This did change the state but then the work item lost the other options so in the web ui there were no other states to choose from apart from the currently selected one also this method is marked as depreciated, the java doc says to use workingCopy.setWorkflowAction(String s) I've tried this but it is set to null before I change it so I'm not sure if this is actually what I want, I've been getting the work flow actions using ItemProfile<IWorkItem> profile = IWorkItem.DEFAULT_PROFILE; So I think the string I am passing in is correct, any ideas on what I'm doing wrong? Also I am saving the working copy of the work item after setting the work flow action. Any help with this would be greatly appreciated. The full code I've been using to do it is below: ItemProfile<IWorkItem> profile = IWorkItem.DEFAULT_PROFILE; |
One answer
If anyone is interested I've found out the correct way to do this courtesy of Luis Carlos Quintela:
"workItemAction" is the name of action to performed such as "start working" IWorkItemClient workItemClient = (IWorkItemClient) repo.getClientLibrary(IWorkItemClient.class); |
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.