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

WorkItem changing status

Hi, I'm trying to change a WorkItem status using a client side follow-up plugin. I get the working copy, set the action and save but no action seems to be triggered. I also try insert another modify action like modifing the description and it runs correctly.

This is my code:

String azione = "Start Working";
IWorkItemClient client = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
IWorkItemWorkingCopyManager WCManager = client.getWorkItemWorkingCopyManager();
WCManager.connect(wiHandle, IWorkItem.FULL_PROFILE, monitor);
WorkItemWorkingCopy wiCopy = WCManager.getWorkingCopy(wiHandle);
String oldContent = wiCopy.getWorkItem().getHTMLDescription().toString();
wiCopy.getWorkItem().setHTMLDescription(XMLString.createFromPlainText(oldContent+";CIAOO"));
wiCopy.setWorkflowAction(azione);
String out = wiCopy.getWorkflowAction();
IDetailedStatus status = wiCopy.save(monitor);
WCManager.disconnect(wiHandle);


I also get the status result of save operation and it gives me OK.
Can I have some help? What is my error?
Thanks.

0 votes


Accepted answer

Permanent link

This shows a state change in a server follow up action: https://rsjazz.wordpress.com/2012/11/27/resolve-parent-if-all-children-are-resolved-participant/ the code in the client should be similar. There are several client API examples on the blog.
Here is the link for how to trigger a build from a state change: https://rsjazz.wordpress.com/2016/07/15/build-on-state-change-work-item-save-participant/

Ralph Schoon selected this answer as the correct answer

0 votes


4 other answers

Permanent link
I've notice that it currently does something, because if I try to set action Resolve from In Progress status (referring to Eclipse Way Default workflow) it moves work item state to New instead of Resolved.
Any help?

0 votes


Permanent link
Hi
You have to pass the id of an action to the workingcopy. To get the set of possible action ids for the current state of a work item, you can use IWorkItemClient#findWorkflowInfo and then WorkflowInfo#getActionIds. Passing one of these ids to the workingcopy should transition the workflow the to end state of that action (which can be accessed programatically using WorklfowInfo#getActionResultState.

Regards

Marcel
Jazz Work Item team

0 votes


Permanent link
Hi Marcel, thank you for your answer.
Really, I would have never thought that String as input parameter of getWorkflowAction method was a conversion from Id. I really had not understood. Thank you very much.

0 votes


Permanent link

Hi Michele,


Am in-between the process of creating custom workitem which will start build when it's staus will change, I have used java client API programs to request Build,Am able to  do this by running as java application. But am not sure how to use this in workitem, how to create an custom workitem to invoke it. could you please help me to sort out. 

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,937

Question asked: Jul 14 '09, 7:25 a.m.

Question was seen: 8,324 times

Last updated: Jun 27 '18, 9:42 a.m.

Confirmation Cancel Confirm