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

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

0 votes

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

Please see the answer to:
(Short answer is 'no', as the filestate could exist in hundreds of streams / snapshots)

showing 5 of 7 show 2 more comments


One answer

Permanent link
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

0 votes

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

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
× 7,495
× 1,700

Question asked: Feb 26 '19, 6:32 a.m.

Question was seen: 2,829 times

Last updated: Mar 04 '19, 4:11 p.m.

Confirmation Cancel Confirm