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

History of one versionable

Hi everybody,

I'm trying to get the history of one versionable in a component using the Java API, in detail I need the informations who changed the file when with what comment.
I'm getting lost in ChangeSet, HistoryEntry, etc. Can someone give me a hint for this?

Thank you!

0 votes



One answer

Permanent link

 Normally, when you request the history of one versionable, you would get an ChangeHistoryEntry[] entries (array).


You can then loop this, and get the information you need (repo is your :

ITeamRepository repo; // you should have this already
IAuditableClient audCli = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
for (ChangeHistoryEntry changeEntry : entries)
{
  ICangeSetHandle csh = changeEntry.getChangeSet();
  IChangeSet cs = repo.itemManager().fetchCompleteItem(handle, ItemManager.DEFAULT, monitor);
  IContributorHandle conHdl = cs.getAuthor(); // this would get you the author. Only the handle though. You need to resolve it as below
  IContributor con = audCli.fetchCurrentAuditable(conHdl, .......... )
  cs.getLastChangeDate(); // get the change time stamp
  cs.getComment(); // get the comment
}


I hope this helps, else just ask again :).

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

Question asked: Apr 08 '16, 3:29 a.m.

Question was seen: 3,241 times

Last updated: May 15 '17, 12:08 p.m.

Confirmation Cancel Confirm