how to get link to a fileitem in ALM RTC if i have itemid/iversionable/ifilitem
how to get link to a fileitem in ALM RTC if i have itemid/iversionable/ifilitem
showing 5 of 7
show 2 more comments
|
One answer
Use the item id and stateId in an scm query.
First, get a handle:
IVersionableHandle nvh = (IVersionableHandle) IFileItem.ITEM_TYPE.createItemHandle(repo, itemIdUUID,
stateIdUUID);
IChangeSetSearchCriteria criteria = IChangeSetSearchCriteria.FACTORY.newInstance();
criteria.setItem(nvh);
IChangeSetHandle csets[] = scmQuerySrv.findChangeSets(criteria, Integer.MAX_VALUE, null, null);
Now that you have the change sets, you can do another query to find the streams/workspaces.
cheers
Steve
Comments Only problem with this is it finds all change sets that touch the file, but based on the previous questions from Akshay, it sounds like a specific file state is requested, in which this approach will not work directly. But I suppose you could fetch all the change sets, then go through the changes of each change set to find the file you one, then check if the stateID matches what you are looking for. Then that would give you 'one' change set that has the fileState (keep in mind there could be multiple change sets in the repo that have the fileState [ex: one could be delivered to a main stream, and the other change set could be delivered to a maintenance stream). Note: This approach would be pretty expensive to do, so hopefully this is not an action that is performed often.
thanks a lot steven sir and david sir
@David, can you please give me format for scm queries for finding changset and streams
Take a look at the code written by Benjamin Maier in: https://jazz.net/forum/questions/235177/how-to-get-the-file-path-of-a-changed-file-in-rtc-with-java
|
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.
Comments
Can you navigate the current RTC SCM Web UI and provide an example of the type of link you are looking for?
https://xyz#action=com.ibm.team.scm.browseElement&workspaceItemId=_efg&componentItemId=_abc&itemType=com.ibm.team.filesystem.FileItem&itemId=_mnp
We just generate the URL in Javascript code, so there's no API or way to re-use it.
Fortunately, now that you know the format you can write your own code to build up the URL (and just replace the itemIds where necessary)
atleast can i find the stream ids/snapshot ids where this file belongs to?
i know the format but i really need snapshot/stream ids mandatory to build a link to file item
please advise