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

RTC Server Extension to save work item

 I tried using method in follow-up actions  :

fWorkItemServer = getService(IWorkItemServer.class);
IWorkItem workingCopy = (IWorkItem) fWorkItemServer
.getAuditableCommon()
.resolveAuditable(workItem, IWorkItem.FULL_PROFILE, monitor)
.getWorkingCopy();
workingCopy.setHTMLDescription(XMLString.createFromPlainText("XXXXX"));
IStatus saveStatus = fWorkItemServer.saveWorkItem2(workingCopy, null, null);

to save work item changes, but it only succeeded when the status of the work item changed. If I change other data but do not modify the status, the execution cannot succeed, and no error is reported.
Are there other methods to save work item modifications?

0 votes


Accepted answer

Permanent link

 Have you looked at any of the examples here: https://rsjazz.wordpress.com/?s=saveWorkItem&submit=Search ?

There are several follow up actions that do similar things - including code - in my blog.

I have done this countless times and I find it quite unbelievable that you do not get a save status or an exception.
If you follow the extensions workshop you should also be able to step through the code. This would also allow you to easily look at the interfaces to see which methods are available (e.g. saveWorkItem3()) and search for the usage of saveWorkItem*() in the SDK code.

cc wang selected this answer as the correct answer

0 votes

Comments

Thank you very much. I have read some of these articles and applied them to my code, which is really helpful to me. I think it was because I thought too little that caused this error, and now I have solved the problem. 

You should also consider to protect the work item save to avoid a recursive save caused by the second save. This ruins your day and crashes the server. This is demonstrated in some of the examples above by using additional save parameters. 

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: Mar 30 '23, 4:01 a.m.

Question was seen: 676 times

Last updated: Mar 30 '23, 5:39 a.m.

Confirmation Cancel Confirm