How to get all state ids of a file in ALM using its UUID?
akshay p (15●1●19)
| asked Feb 06 '19, 1:48 a.m.
edited Feb 06 '19, 2:30 a.m. by Ralph Schoon (63.6k●3●36●46) I have a stream1 and a comp inside it. i created a file xyz here.
|
Accepted answer
To get the history of the file:
IScmService scmService = getService(IScmService.class);
ServiceHistoryProvider historyProvider = ServiceHistoryProvider.FACTORY.create(workspaceHandle, componentHandle);
IVersionableHandle versionableHandle = (IVersionableHandle) type.createItemHandle(Versionable_UUID, null);
scmService.getHistoryForVersionable(historyProvider, versionableHandle, 100, false, null, null);
This would return you 100 of the most recent states of the file.
akshay p selected this answer as the correct answer
Comments
thank you sir.
Also can you tell me regarding getService(IScmService.class) and
(IVersionableHandle) type
IScmService scmService = ((IClientLibraryContext) repo).getServiceInterface(IScmService.class);
IItemType type = IItemType.IRegistry.INSTANCE.getItemType("FileItem", "com.ibm.team.filesystem");
thank you sir
Is there any way i can get the IFileItem or Iversionable just by knowing ITEM id and state id ?
Thanks in advance
akshay p
commented Feb 21 '19, 12:22 a.m.
how can i get the relative path of the file
David Lafreniere
commented Feb 21 '19, 12:23 p.m.
| edited Feb 21 '19, 12:25 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
You can use:
IScmService.configurationLocateAncestors(...)
or
IScmService.configurationDetermineAncestorsInHistory(...) (this will give you the path of a file even if it was recently deleted in the stream - it goes through the change set history to try to find the path where the file used to be).
|
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.