It's all about the answers!

Ask a question

How to get history of a file API


Yehiel Glass (25538986) | asked Oct 20 '13, 11:30 a.m.
retagged Dec 03 '13, 4:47 p.m. by David Lafreniere (4.8k7)
Hello,
I need to get the Work-item of the last change-set in a stream,  on deliver operation.
I already have the change-set. How can I search for the last Change-set like I can do in the Eclipse (History view, or search for change-set action) ?
I'm using server side plugin API .
Thanks,
Yehiel

2 answers



permanent link
Yehiel Glass (25538986) | answered Oct 24 '13, 10:11 a.m.

Hi,

I saw this:

IScmService scmService = getService(IScmService.class);

scmService.getHistoryForVersionable(ServiceHistoryProvider, versionableHandle, 2, false, null, monitor);

The new problem is that I don't know how to get the ServiceHistoryProvider.

Does someone knows if this is the right way to get the history Change-sets of a file?
How can I get this service ?

Thanks.


Comments
Ralph Schoon commented Dec 04 '13, 6:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would suggest to look into the class/interface that is used in the call and do a Java Search on the SDK to find the class, or an implementor. You can also easily search the SDK in the Eclipse PDE for where that operation is used and look at what classes are used there and how to get one of those.


1
Gidi Gal commented Oct 16 '18, 2:50 a.m.
I found this public API to retrieve history of a versionable:
com.ibm.team.scm.client.IChangeHistory.getHistoryFor(IVersionableHandle versionableHandle, int limit, IProgressMonitor monitor)

You can get IChangeHistory using this public API:

IChangeHistory com.ibm.team.scm.client.IFlowNodeConnection.changeHistory(IComponentHandle component)

permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Oct 21 '13, 7:32 a.m.
JAZZ DEVELOPER
Hi Yehiel,
This post addresses how to get the work item associated with a changeset:  https://jazz.net/forum/questions/92467/how-to-get-workitem-from-changeset-inside-the-plugin

Comments
Yehiel Glass commented Oct 21 '13, 11:12 a.m.

Hi,

My goal  is to get the last work-item for each changed file in the changeset.

I have the change-set and the changes contained in it, but how can I get for each change, the predecessor change (in the history) and it's related Work-item ?

Any idea ?


Lauren Hayward Schaefer commented Oct 22 '13, 7:55 a.m.
JAZZ DEVELOPER

Hi Yehiel,
I'm not sure how to get a predecessor change.  Perhaps someone else can answer that.

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.