It's all about the answers!

Ask a question

Set state of workitem while creating using Plain java Client


Sudipto Sarkar (631343) | asked Sep 24 '15, 8:32 a.m.
Hello All,

 I am trying to create a workitem using plain java client. But my use case is to set the status to "In progress". Is it possible to set the state of workitem directly to "In progress". If yes, how can it be done.

Thanks,#Sud

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Sep 24 '15, 8:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Usually, when creating a work item, the initial activity will be used to set the initial state of the work item.

You have two options:
1. Pick a work flow action and provide that in a second save - the work item would undergo a valid workflow action and all workflow operational behavior is used.
2. Use the deprecated API setState2() to set a state - this avoids all regular workflow and is therefore not desirable, but it can be used in the initial save as well.

For some ideas about how to access workflows and states see https://rsjazz.wordpress.com/2012/11/26/manipulating-work-item-states/ which explains all this.

PS: You can use Google to search and you can use the search box on https://rsjazz.wordpress.com/ to find examples for a lot of questions you might have.
Sudipto Sarkar selected this answer as the correct answer

Comments
Sudipto Sarkar commented Sep 29 '15, 9:21 a.m.

Hi Ralph,

 I used the 2nd option. It works.

Thanks!


Ralph Schoon commented Sep 29 '15, 9:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Mind that it is deprecated and could be removed at any time. Mind that it is also the only way to do it in one step. Also mind that it does not trigger a workflow action and if you have operational behavior configured it might not get triggered.

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.