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

Getting a change set handle from a change set id

I'm working on some configuration management tools to interface with RTC using the Plain Java Libraries. I have a change set id -- like "_ZYdu...pakQ" -- that was saved off when we added change sets to RTC. I want to later use that change set ID to get the IChangeSetHandle to link our tools back to RTC. I think I have the first and last bits figured out:

String changeSetId = "something"

IWorkspaceManager wm = SCMPlatform.getWorkspaceManager(REPO);

IChangeSetSearchCriteria criteria = IChangeSetSearchCriteria.FACTORY.newInstance();

???????????????

List<IChangeSetHandle> results = wm.findChangeSets(changeSetCriteria, IWorkspaceManager.MAX_QUERY_SIZE, MONITOR);

IChangeSetHandle handle = results.get(0); //Should only be one match with that ID

...but I can't figure out the middle part to define the criteria. I tried:

criteria.setSourceId(UUID.valueOf(changeSetId));

...but that didn't work. What am I missing?

0 votes


Accepted answer

Permanent link
Generally the way to get an object from its UUID is the following:

ObjectInterface.ITEM_TYPE.createItemHandle(UUID.valueOf(uuidValue), null);

In your case it will be

IChangeSetHandle handle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(UUID.valueOf("_ZYdu...pakQ"), null);

Michele.
Doug Effler selected this answer as the correct answer

0 votes

Comments

That worked for me. Thank you very much. :-D

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
× 10,941

Question asked: Mar 23 '16, 6:32 p.m.

Question was seen: 1,610 times

Last updated: Mar 24 '16, 10:20 a.m.

Confirmation Cancel Confirm