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

Changing workitem state programatically

Hi

I want to change the state of the workitem using RTC JAVA API's.

Please let me know , if anyone has any information on this.

0 votes



3 answers

Permanent link
I want to change the state of the workitem using RTC JAVA API's.

Please let me know , if anyone has any information on this.

On the client, you can use

com.ibm.team.workitem.client.WorkItemWorkingCopy.setWorkflowAction(String)

On the server, you pass the action ID on save:

com.ibm.team.workitem.service.IWorkItemServer.saveWorkItem2(IWorkItem,
IWorkItemReferences, String)


--
Regards,
Patrick
RTC Work Item Component Lead

0 votes


Permanent link
Patrick

Thanks for your response , actually we are using the OperationParticipant for the below functionality:

1) Read the values of custom attributes from the work item.
2) Create the RTC project area with name as values of custom attibuites.
2) Populate the custom attribute with the value of other custom attibute values.ex: valueOf(attribute4)=valueOf(attibute1+attibute2+attibute3) but and to this we are using workItemCopy.save(null); from the client side but when we execute the save methos it again and again calls the Operation participant.

And as per your response ew need to call the save method after chaging the workflow action but that will also call the operation participant again

Note: we use Operation Particapnt just to call the client side code to create the Project area and populate the custom attributes.

0 votes


Permanent link
Hi Dashrath,

I missed this one. Maybe you can do something in the Operation Participant that makes sure that subsequent calls can be filtered out?

Here is some code to begin with from the Extesibility Workshop on Jazz.net:


if (data instanceof ISaveParameter) {
saveParameter = (ISaveParameter) data;
/*
* If the state id has not changed, do not build.
*/
IWorkItem newState = (IWorkItem) saveParameter.getNewState();
Identifier<IState> newStateId = newState.getState2();
Identifier<IState> oldStateId = null;
IWorkItem oldState = (IWorkItem) saveParameter.getOldState();
if (oldState != null) // New work item check.
oldStateId = oldState.getState2();
if ((newStateId != null) && !(newStateId.equals(oldStateId))) {




Patrick

Thanks for your response , actually we are using the OperationParticipant for the below functionality:

1) Read the values of custom attributes from the work item.
2) Create the RTC project area with name as values of custom attibuites.
2) Populate the custom attribute with the value of other custom attibute values.ex: valueOf(attribute4)=valueOf(attibute1+attibute2+attibute3) but and to this we are using workItemCopy.save(null); from the client side but when we execute the save methos it again and again calls the Operation participant.

And as per your response ew need to call the save method after chaging the workflow action but that will also call the operation participant again

Note: we use Operation Particapnt just to call the client side code to create the Project area and populate the custom attributes.

0 votes

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: Jan 17 '11, 12:45 a.m.

Question was seen: 6,919 times

Last updated: Jan 17 '11, 12:45 a.m.

Confirmation Cancel Confirm