It's all about the answers!

Ask a question

How can I retrieve date added property from change sets using server api?


Stefan Sauterleute (2815) | asked Jul 20 '17, 8:50 a.m.

Hi @ all,

I try to get the date added property of a change set in workspaces.

For clients following code is working:

        IWorkspaceConnection repoWorkspace = findWorkspace(repositoryWorkspaceName);

List<IComponentHandle> components = repoWorkspace.getComponents();

for (IComponentHandle componentHandle : components) {
IChangeHistory changeHistory = repoWorkspace.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());
}
}

However I want to retrieve the date added without client api. So I didn't have the client classes. For example there is no IWorkspaceConnection and IChangeHistory class in the server api.

Is there someone who can help me to get IChangeHistoryEntryChange objects without using client classes?
Or is there another way to get the date added from change sets in workspaces?

Thanks in advance.

Be the first one to answer this question!


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.