How to get OperationHistory of the stream programmatically using RTC api?
Hello Team,
Usecase:
We are actually planning to clean up some of the Streams in the Project area ( 40+).
to do this activity, we would like to have a report showing which streams are actively working(Some operation happening in the Stream) or which are not( Operations done few months back like Changeset deliver,,,)
In Eclipse Client, we can see this using Operation History option, which gives me operations currently happening in the Stream. But doing this for all the 40+ streams is difficult.
So could you please support how to achieve this use case using RTC API?
Thanks in advance!!
Accepted answer
Note: This is not official API, however here is the way to retrieve the same information that would be shown in the Operation History view in Eclipse:
ParmsGetWorkspaceHistory parms = new ParmsGetWorkspaceHistory();
parms.workspaceId = uuidOfStream;
parms.includeDetails = false; // We don't care about all the details, only the time really....
parms.maxResultSize = 1; // We just need the most recent operation entry
IScmRichClientRestService scmService = (IScmRichClientRestService) ((IClientLibraryContext) repository).getServiceInterface(IScmRichClientRestService.class);
ScmWorkspaceHistory workspaceHistory = scmService.postGetWorkspaceHistory(parms);
if (workspaceHistory.getHistoryEntries().size() > 0) {
ScmWorkspaceHistoryEntry entry = (ScmWorkspaceHistoryEntry) workspaceHistory.getHistoryEntries().get(0);
date = entry.getDate(); // This is the date of the last operation against this stream....
}
parms.workspaceId = uuidOfStream;
parms.includeDetails = false; // We don't care about all the details, only the time really....
parms.maxResultSize = 1; // We just need the most recent operation entry
IScmRichClientRestService scmService = (IScmRichClientRestService) ((IClientLibraryContext) repository).getServiceInterface(IScmRichClientRestService.class);
ScmWorkspaceHistory workspaceHistory = scmService.postGetWorkspaceHistory(parms);
if (workspaceHistory.getHistoryEntries().size() > 0) {
ScmWorkspaceHistoryEntry entry = (ScmWorkspaceHistoryEntry) workspaceHistory.getHistoryEntries().get(0);
date = entry.getDate(); // This is the date of the last operation against this stream....
}
Comments
1 vote
1 vote
1 vote
1 vote
1 vote
1 vote
showing 5 of 19
show 14 more comments
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 18 '19, 2:50 a.m.Rajat Krishnan
Dec 18 '19, 4:34 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Dec 18 '19, 4:48 a.m.