How to get the current work item programmatically?
I'm looking for a way to extend the RTC client to get the current work item programmatically, or even better add a listener that notifies me whenever the current work item is changed.
I don't know where to start. Any hints? |
3 answers
far as I know, there is no general purpose listener chain you can use.
the code to save a workitem is in the com.ibm.team.workitem.client jar, com.ibm.team.workitem.client.internal.WorkitemClient.java to view the source for any plugin jar, use the Plugins view of the Plugins Perspective,, find the plugin of interest, and right mouse button, select Import as Source then u have the full compilable plugin jar file source and build process. Comments
S M
commented Nov 23 '12, 5:38 p.m.
Thanks, I tried this. However, the projects that are loaded are always empty (no code, just one jar), and com.ibm.team.workitem.client.internal is not even available.
sam detweiler
commented Nov 23 '12, 7:54 p.m.
you have to download the source zip and configure the plugin path to get the source to deploy for plugins..
See the Extensions workshop for how to set up for development.
|
Hi S M,
It is indeed possible to get a listener for the work item activation. Please look at the method:
com.ibm.team.workitem.rcp.core.ClientModel.getWorkItemActivationManager()
That static method will return you an instance of an IWorkItemActivationManager which manages the active (current) work item status. If you just want to get the currently active workitem you can use the method com.ibm.team.workitem.rcp.core.activation.IWorkItemActivationManager.getActiveWorkItem(). Otherwise, you can register a listener by calling com.ibm.team.workitem.rcp.core.activation.IWorkItemActivationManager.addActivationParticipant(WorkItemActivationParticipant) and adding your own WorkItemActivationParticipant.
Please consult the Javadoc for further information
|
thanks. never saw this anywhere.. the rcp.core.Clientmodel.... is not published in the javadoc
IWorkitemClient.addListener(listener ) |
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.