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

In the RTC Java-API, how do I retrieve the "date added" property of a changeset to a workspace?

Given a stream, how do I retrieve the list of changesets as well as the "date added" property for these changesets? I can only find the getLastChangeDate() method in IChangeSet.

1

0 votes


Accepted answer

Permanent link

With the client api you can retrieve the date added with using IWorkspaceConnection class.

Finally you get objects from type IChangeHistoryEntryChange. On this objects you can get the date added with invoke the creationDate() method.

IWorkspaceConnection stream = findWorkspace(repositoryWorkspaceName);
List<IComponentHandle> components = stream .getComponents();

for (IComponentHandle componentHandle : components) {
IChangeHistory changeHistory = stream .changeHistory(componentHandle);

IComponent component = (IComponent) repository.itemManager().fetchCompleteItem(componentHandle,
IItemManager.REFRESH, null);
System.out.println("Component: " + component.getName());
System.out.println("==========================================================");

List<IChangeHistoryEntryChange> historyEntries = changeHistory.recent(monitor);

System.out.println("Comment" + " \t" + "Date Creaded" + " \t" + "Added By" + " \t" + "Date Added");
for (IChangeHistoryEntryChange changeHistoryEntry : historyEntries) {
IChangeSet changeSet = (IChangeSet) repository.itemManager().fetchCompleteItem(
changeHistoryEntry.changeSet(), IItemManager.REFRESH, null);
IContributor user = (IContributor) repository.itemManager().fetchCompleteItem(
changeHistoryEntry.createdBy(), IItemManager.REFRESH, null);

System.out.println(changeSet.getComment() + " \t" + changeSet.getLastChangeDate() + " \t" + user.getName()
+ " \t" + changeHistoryEntry.creationDate());
}
}

Timothy Tan selected this answer as the correct answer

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,950
× 411

Question asked: Jul 13 '17, 6:16 a.m.

Question was seen: 2,254 times

Last updated: Jul 20 '17, 8:57 a.m.

Confirmation Cancel Confirm