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

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?

0 votes



3 answers

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

1 vote

Comments

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.

you have to download the source zip and configure the plugin path to get the source to deploy for plugins..

thats in the Eclipse ui menu, Windows, Preferences, Plugins, target Platform

See the Extensions workshop for how to set up for development.


Permanent link
 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

0 votes


Permanent link
thanks. never saw this anywhere.. the rcp.core.Clientmodel.... is not published in the javadoc

IWorkitemClient.addListener(listener )

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

Question asked: Nov 23 '12, 3:36 p.m.

Question was seen: 5,502 times

Last updated: Nov 26 '12, 9:29 a.m.

Confirmation Cancel Confirm