Issue in getting updated Work item in Plugin 2 saved in Plugin 1?
Can anyone help us with how to get an updated copy of work item in plugin 2 considering a scenario as plugin 1 is updating the work item and plugin 2 need to access the updates done by plugin 1 in work item.
we are using getWorkingCopy() method to get the fresh copy of workitem in the plugin.
|
One answer
Ralph Schoon (63.4k●3●36●46)
| answered Jan 05 '17, 4:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The extensions are automatically called by the framework and there are only limited capabilities to communicate between the plugins. It is also important to understand that a save in a follow up action will cause a new save event and a subsequent call of all related pre conditions and follow up actions (process advisors and - participants).
The easiest way to pass information is to use additional save parameter - basically a string - during work item save. The parameter will be available to the subsequently called process advisors and - participants. This can be used for the abve purpose and to prevent recursive descent as well. See https://rsjazz.wordpress.com/2016/10/24/using-the-work-item-server-api-to-create-work-items/ Set additionalParams = new HashSet(); additionalParams.add(ICreateTracedWorkItemsParticipant.CREATE_TRACED_WORKITEMS_PARTICIPANTS_ACTION_SAVENEW); fWorkItemServer.saveWorkItem3(newWorkItem, null, null, additionalParams); return newWorkItem; |
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.