It's all about the answers!

Ask a question

How can I change the state of a work item from New to Start Working using Plain Java API?

Sapan Desai (5625) | asked Aug 03 '12, 12:10 p.m.
I want to create a custom event which when triggered will change the state of a work item.  For that I would like to know how to change the state of work item programmatically using plain java API.

One answer

permanent link
sam detweiler (12.5k6195201) | answered Aug 03 '12, 5:02 p.m.
what does 'event' mean? who fires this 'event'..

to change a state you would
get the workitem handle, (find by name, id, tag, , .... somehow)
then get its full state, (read only)
then get its workingCopy (changeable) thru the workItemClient service methods

and then using its workingcopy get the allowed actions (start working, set resolved) from the workitems current state, and then use the workingcopy. setWorkflowAction(java.lang.String action) to set the action to be executed when the copy is saved...

then save, via the fucntion..

all this I found thru looking at the javadoc for the plainjava libraries.

I don' have a sample like this

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.