It's all about the answers!

Ask a question

RTC Server Extension to save work item


cc wang (132) | asked Mar 30 '23, 4:01 a.m.
edited Mar 30 '23, 4:06 a.m.

 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?

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Mar 30 '23, 5:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Mar 30 '23, 5:04 a.m.

 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

Comments
cc wang commented Mar 30 '23, 5:21 a.m.

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. 


Ralph Schoon commented Mar 30 '23, 5:39 a.m. | edited Mar 30 '23, 5:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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