Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Set state of workitem while creating using Plain java Client

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

0 votes


Accepted answer

Permanent link
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

0 votes

Comments

Hi Ralph,

 I used the 2nd option. It works.

Thanks!

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Sep 24 '15, 8:32 a.m.

Question was seen: 2,153 times

Last updated: Sep 29 '15, 9:38 a.m.

Confirmation Cancel Confirm